ImmutablePair.h 517 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. namespace Framework
  3. {
  4. template<typename First, typename Second>
  5. class ImmutablePair
  6. {
  7. private:
  8. First first;
  9. Second second;
  10. public:
  11. ImmutablePair()
  12. {}
  13. ImmutablePair(const First& first, const Second& second)
  14. : first(first),
  15. second(second)
  16. {}
  17. ImmutablePair(const ImmutablePair<First, Second>& other)
  18. : first(other.first),
  19. second(other.second)
  20. {}
  21. const First& getFirst() const
  22. {
  23. return first;
  24. }
  25. const Second& getSecond() const
  26. {
  27. return second;
  28. }
  29. };
  30. }