multimap::value_comp (STL/CLR)
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at multimap::value_comp (STL/CLR).
Copies the ordering delegate for two element values.
Syntax
value_compare^ value_comp();
Remarks
The member function returns the ordering delegate used to order the controlled sequence. You use it to compare two element values.
Example
// cliext_multimap_value_comp.cpp
// compile with: /clr
#include <cliext/map>
typedef cliext::map<wchar_t, int> Mymultimap;
int main()
{
Mymultimap c1;
Mymultimap::value_compare^ kcomp = c1.value_comp();
System::Console::WriteLine("compare([L'a', 1], [L'a', 1]) = {0}",
kcomp(Mymultimap::make_value(L'a', 1),
Mymultimap::make_value(L'a', 1)));
System::Console::WriteLine("compare([L'a', 1], [L'b', 2]) = {0}",
kcomp(Mymultimap::make_value(L'a', 1),
Mymultimap::make_value(L'b', 2)));
System::Console::WriteLine("compare([L'b', 2], [L'a', 1]) = {0}",
kcomp(Mymultimap::make_value(L'b', 2),
Mymultimap::make_value(L'a', 1)));
System::Console::WriteLine();
return (0);
}
compare
([L'a', 1], [L'a', 1]) = False
compare
([L'a', 1], [L'b', 2]) = True
compare
([L'b', 2], [L'a', 1]) = False
Requirements
Header: <cliext/map>
Namespace: cliext
See Also
multimap (STL/CLR)
multimap::value_compare (STL/CLR)
multimap::value_type (STL/CLR)