Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 line
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. }