From 4993c6468aa07e7c6a006a721fe82aaa4413eede Mon Sep 17 00:00:00 2001 From: angeld55 Date: Tue, 17 May 2022 20:42:42 +0300 Subject: added bar task --- Sem. 11/Examples/Bar/Pair/Pair.hpp | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Sem. 11/Examples/Bar/Pair/Pair.hpp (limited to 'Sem. 11/Examples/Bar/Pair') diff --git a/Sem. 11/Examples/Bar/Pair/Pair.hpp b/Sem. 11/Examples/Bar/Pair/Pair.hpp new file mode 100644 index 0000000..5f83d0c --- /dev/null +++ b/Sem. 11/Examples/Bar/Pair/Pair.hpp @@ -0,0 +1,43 @@ +#pragma once + +template +class Pair +{ + T first; + mutable D second; // For Drinks task!! +public: + Pair() = default; + Pair(const T& first, const D& second); + const T& getFirst() const; + const D& getSecond() const; + + void setFirst(const T& newValue); + void setSecond(const D& newValue) const ; +}; + +template +Pair::Pair(const T& first, const D& second) : first(first), second(second) +{} + +template +const T& Pair::getFirst() const +{ + return first; +} +template +const D& Pair::getSecond() const +{ + return second; +} + +template +void Pair::setFirst(const T& newValue) +{ + first = newValue; +} + +template +void Pair::setSecond(const D& newValue) const +{ + second = newValue; +} \ No newline at end of file -- cgit v1.3.1-23-gd82d