Website Summary Files Commits Branches @commit @diff @stats
path: root / week10 / Exercise02
diff options
context:
space:
mode:
1 files changed, 7 insertions, 3 deletions
-rw-r--r--week10/Exercise02/Array.hpp10
diff --git a/week10/Exercise02/Array.hpp b/week10/Exercise02/Array.hpp
index 114a1bc..6c2d95b 100644
--- a/week10/Exercise02/Array.hpp
+++ b/week10/Exercise02/Array.hpp
@@ -22,9 +22,13 @@ public:
T& operator[](unsigned index);
T& operator[](unsigned index) const;
Array<T>& operator+=(const Array<T>& right);
- friend bool operator==(const Array<T>& left, const Array<T>& right);
- friend bool operator!=(const Array<T>& left, const Array<T>& right);
- friend Array<T> operator+(const Array<T>& left, const Array<T>& right);
+
+ template <class U>
+ friend bool operator==(const Array<U>& left, const Array<U>& right);
+ template <class U>
+ friend bool operator!=(const Array<U>& left, const Array<U>& right);
+ template <class U>
+ friend Array<U> operator+(const Array<U>& left, const Array<U>& right);
};
template <class T>