KeyValuePair

KeyValuePair class

Pair of key and value. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

template<typename TKey,typename TValue>class KeyValuePair

Methods

MethodDescription
const TKey& get_Key() constGets key.
const TValue& get_Value() constGets value.
int GetHashCode() constCalculates key-value pair hash by xoring key’s and value’s hashes.
bool IsNull() constAlways returns false.
KeyValuePair()Null key-value pair initializer.
KeyValuePair(const TKey&, const TValue&)Constructor.
KeyValuePair(const std::pair<OtherK, OtherV>&)Type conversion constructor.
bool operator<(const KeyValuePair&) constPatch for classes inherited from IComparer<KeyValuePair<TKey, TValue», doesn’t compare anything.
String ToString() constConverts key-value pair to string.

See Also