aboutsummaryrefslogtreecommitdiff
path: root/week07/Exercise6.h
diff options
context:
space:
mode:
Diffstat (limited to 'week07/Exercise6.h')
-rw-r--r--week07/Exercise6.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/week07/Exercise6.h b/week07/Exercise6.h
new file mode 100644
index 0000000..ab5df9e
--- /dev/null
+++ b/week07/Exercise6.h
@@ -0,0 +1,27 @@
+#include <iostream>
+
+class Matrix {
+ int values[4];
+
+ void addBy(int amount);
+
+public:
+ Matrix(int a, int b, int c, int d);
+
+ Matrix& operator++();
+ Matrix operator++(int);
+ Matrix& operator--();
+ Matrix operator--(int);
+
+ Matrix& operator+=(const Matrix& rhs);
+ Matrix& operator-=(const Matrix& rhs);
+ Matrix& operator*=(const Matrix& rhs);
+
+ friend Matrix operator+(const Matrix& lhs, const Matrix& rhs);
+ friend Matrix operator-(const Matrix& lhs, const Matrix& rhs);
+ friend Matrix operator*(const Matrix& lhs, const Matrix& rhs);
+
+ friend std::ostream& operator<<(std::ostream& lhs, const Matrix& rhs);
+ friend std::istream& operator>>(std::istream& lhs, Matrix& rhs);
+};
+