geekbrains_oop_cpp/lesson_5/exercise_1.hpp

30 lines
425 B
C++
Raw Normal View History

2021-07-04 00:58:03 +00:00
#ifndef EXERCISE_1_HPP_
#define EXERCISE_1_HPP_
template <typename T>
class Pair1
{
private:
T m_first;
T m_second;
public:
Pair1(const T& first, const T& second) : m_first(first), m_second(second) { }
const T& first() const;
const T& second() const;
};
template <typename T>
const T& Pair1<T>::first() const
{
return m_first;
}
template <typename T>
const T& Pair1<T>::second() const
{
return m_second;
}
#endif