From 5e9cb4ddc811465731596d8ee684f3d8cd5a6aea Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 2 May 2026 16:05:06 +0300 Subject: feat(Week11): Add solutions --- Week11/Exercise01/Pair.hpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Week11/Exercise01/Pair.hpp (limited to 'Week11/Exercise01') 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 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 +Pair::Pair(const T& left, const U& right) : left(left), right(right) +{ } + +template +T& Pair::Left() { + return left; +} + +template +const T& Pair::Left() const { + return left; +} + +template +U& Pair::Right() { + return right; +} + +template +const U& Pair::Right() const { + return right; +} + +#endif /* _PAIR */ -- cgit v1.3.1-23-gd82d