System::Collections::Generic::KeyValuePair 类

KeyValuePair class

键和值的配对。此类型应在栈上分配,并通过值或引用传递给函数。切勿使用 System::SmartPtr 类管理此类型的对象。

template<typename TKey,typename TValue>class KeyValuePair

方法

方法描述
get_Key() const获取键。
get_Value() const获取值。
GetHashCode() const通过对键的哈希值和值的哈希值进行异或来计算键值对的哈希。
IsNull() const始终返回 false。
KeyValuePair()空键值对初始化器。
KeyValuePair(const TKey&, const TValue&)构造函数。
KeyValuePair(const std::pair<OtherK, OtherV>&)类型转换构造函数。
operator<(const KeyValuePair&) const针对从 IComparer<KeyValuePair<TKey, TValue» 继承的类的补丁,不执行任何比较。
ToString() const将键值对转换为字符串。

另见