priority_queue::value_comp (STL/CLR)
두 요소의 순서 지정 대리자를 복사합니다.
value_compare^ value_comp();
설명
멤버 함수가 제어 된 시퀀스를 정렬 하는 데 사용 되는 순서 지정 대리자를 반환 합니다.이를 통해 두 값을 비교할 수 있습니다.
예제
// cliext_priority_queue_value_comp.cpp
// compile with: /clr
#include <cliext/queue>
typedef cliext::priority_queue<wchar_t> Mypriority_queue;
int main()
{
Mypriority_queue c1;
Mypriority_queue::value_compare^ vcomp = c1.value_comp();
System::Console::WriteLine("compare(L'a', L'a') = {0}",
vcomp(L'a', L'a'));
System::Console::WriteLine("compare(L'a', L'b') = {0}",
vcomp(L'a', L'b'));
System::Console::WriteLine("compare(L'b', L'a') = {0}",
vcomp(L'b', L'a'));
System::Console::WriteLine();
// test a different ordering rule
Mypriority_queue c2 = cliext::greater<wchar_t>();
vcomp = c2.value_comp();
System::Console::WriteLine("compare(L'a', L'a') = {0}",
vcomp(L'a', L'a'));
System::Console::WriteLine("compare(L'a', L'b') = {0}",
vcomp(L'a', L'b'));
System::Console::WriteLine("compare(L'b', L'a') = {0}",
vcomp(L'b', L'a'));
return (0);
}
요구 사항
헤더: < cliext/큐 >
네임 스페이스: cliext