Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

26 строки
560B

  1. #include <iostream>
  2. #include <vector>
  3. template <class T, int N>
  4. class Vector {
  5. public:
  6. Vector<T,N> operator+(const Vector<T,N>& y); // Vektoraddition
  7. //T operator*(const Vector<T,n>& y); // Skalarprodukt
  8. private:
  9. std::vector<T> _vector[N];
  10. };
  11. template <class A, int N>
  12. Vector<A,N> Vector<A, N>::operator+(const Vector<B,N>& y) {
  13. //for(int i = 0; i < _vector.last; i++) {
  14. // std::cout << _vector[i] << std::endl;
  15. //}
  16. return y;
  17. }
  18. int main() {
  19. Vector<double, 3> a;
  20. Vector<double, 3> b;
  21. b = a+a;
  22. }