hash_map::value_compare (STL/CLR)
两个元素值的排序委托。
Microsoft::VisualC::StlClr::BinaryDelegate<generic_value, generic_value, bool>
value_compare;
备注
类型确定其排序值变量委托的同义词。
示例
// cliext_hash_map_value_compare.cpp
// compile with: /clr
#include <cliext/hash_map>
typedef cliext::hash_map<wchar_t, int> Myhash_map;
int main()
{
Myhash_map c1;
Myhash_map::value_compare^ kcomp = c1.value_comp();
System::Console::WriteLine("compare([L'a', 1], [L'a', 1]) = {0}",
kcomp(Myhash_map::make_value(L'a', 1),
Myhash_map::make_value(L'a', 1)));
System::Console::WriteLine("compare([L'a', 1], [L'b', 2]) = {0}",
kcomp(Myhash_map::make_value(L'a', 1),
Myhash_map::make_value(L'b', 2)));
System::Console::WriteLine("compare([L'b', 2], [L'a', 1]) = {0}",
kcomp(Myhash_map::make_value(L'b', 2),
Myhash_map::make_value(L'a', 1)));
System::Console::WriteLine();
return (0);
}
要求
标头: <cliext/hash_map>
命名空间: cliext
请参见
参考
hash_map::key_compare (STL/CLR)