Website Summary Files Commits Branches @commit @diff @stats
path: root / Week11 / Exercise01
diff options
context:
space:
mode:
Commit5e9cb4ddc811465731596d8ee684f3d8cd5a6aea (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-05-02 16:05:06 +0300
Committer
 Syndamia <kamen@syndamia.com>
2026-05-02 16:05:06 +0300
Files33a9268d1136974d2ef138364dde508ba43b4a52 /Week11/Exercise01
oop-2025-solutions-main.tar
oop-2025-solutions-main.tar.gz
oop-2025-solutions-main.zip
Parent7546f0d0da487e16f0a8671c09a46e1cee2bc03a (diff)
feat(Week11): Add solutions HEAD main
1 files changed, 43 insertions, 0 deletions
-rw-r--r--Week11/Exercise01/Pair.hpp43
diff --git a/Week11/Exercise01/Pair.hpp b/Week11/Exercise01/Pair.hpp
new file mode 100644
index 0000000..4fd47fd
--- /dev/null
+++ b/Week11/Exercise01/Pair.hpp
@@ -0,0 +1,43 @@
+#ifndef _PAIR
+#define _PAIR
+
+template<class T, class U>
+class Pair {
+ T left;
+ U right;
+
+public:
+ Pair(const T& left, const U& right);
+
+ T& Left();
+ const T& Left() const;
+
+ U& Right();
+ const U& Right() const;
+};
+
+template<class T, class U>
+Pair<T, U>::Pair(const T& left, const U& right) : left(left), right(right)
+{ }
+
+template<class T, class U>
+T& Pair<T, U>::Left() {
+ return left;
+}
+
+template<class T, class U>
+const T& Pair<T, U>::Left() const {
+ return left;
+}
+
+template<class T, class U>
+U& Pair<T, U>::Right() {
+ return right;
+}
+
+template<class T, class U>
+const U& Pair<T, U>::Right() const {
+ return right;
+}
+
+#endif /* _PAIR */