KeyValuePair.h 988 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace JsUtil
  7. {
  8. template <class TKey, class TValue> struct KeyValuePair
  9. {
  10. private:
  11. TKey key;
  12. TValue value;
  13. public:
  14. KeyValuePair()
  15. {
  16. }
  17. KeyValuePair(TKey key, TValue value)
  18. {
  19. this->key = key;
  20. this->value = value;
  21. }
  22. KeyValuePair(const KeyValuePair& other)
  23. : key(other.key), value(other.value)
  24. {}
  25. TKey Key() { return key; }
  26. TKey Key() const { return key; }
  27. TValue Value() { return value; }
  28. TValue Value() const { return value; }
  29. };
  30. }