다음을 통해 공유


set::key_compare (STL/CLR)

두 키에 대 한 순서 지정 대리자입니다.

    Microsoft::VisualC::StlClr::BinaryDelegate<GKey, GKey, bool>
        key_compare;

설명

인수 키의 순서를 결정 하는 대리자에 대 한 동의어입니다.

예제

// cliext_set_key_compare.cpp 
// compile with: /clr 
#include <cliext/set> 
 
typedef cliext::set<wchar_t> Myset; 
int main() 
    { 
    Myset c1; 
    Myset::key_compare^ kcomp = c1.key_comp(); 
 
    System::Console::WriteLine("compare(L'a', L'a') = {0}", 
        kcomp(L'a', L'a')); 
    System::Console::WriteLine("compare(L'a', L'b') = {0}", 
        kcomp(L'a', L'b')); 
    System::Console::WriteLine("compare(L'b', L'a') = {0}", 
        kcomp(L'b', L'a')); 
    System::Console::WriteLine(); 
 
// test a different ordering rule 
    Myset c2 = cliext::greater<wchar_t>(); 
    kcomp = c2.key_comp(); 
 
    System::Console::WriteLine("compare(L'a', L'a') = {0}", 
        kcomp(L'a', L'a')); 
    System::Console::WriteLine("compare(L'a', L'b') = {0}", 
        kcomp(L'a', L'b')); 
    System::Console::WriteLine("compare(L'b', L'a') = {0}", 
        kcomp(L'b', L'a')); 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/설정 >

네임 스페이스: cliext

참고 항목

참조

set (STL/CLR)

set::key_comp (STL/CLR)

set::key_type (STL/CLR)

set::value_compare (STL/CLR)