다음을 통해 공유


hash_multiset::value_comp

[!참고]

이 API는 사용되지 않습니다.대신 unordered_multiset Class.

순서는 hash_multiset 요소 값을 사용한 비교 개체의 복사본을 검색 합니다.

value_compare value_comp( ) const;

반환 값

Hash_multiset 템플릿 매개 변수를 반환 합니다. Traits, 해시 및 컨테이너의 순서 대로 요소에 사용 되는 함수 개체를 포함 합니다.

에 대 한 자세한 내용은 Traits 참조 된 hash_multiset Class 항목.

설명

저장 된 개체 멤버 함수를 정의합니다.

bool operator(constKey&_xVal, const Key& _yVal);

반환 true 경우 _xVal 앞에 같지 않은 경우 _yVal 정렬 순서에서입니다.

이때 두 key_comparevalue_compare 템플릿 매개 변수에 대 한 동의어는 성분.두 형식 모두 hash_multiset 및 위치 구분 되는 동일 하 게, hash_map 및 hash_multimap 클래스와 호환 되는 hash_multiset 클래스에 대해 제공 됩니다.

Visual C++.NET 2003 멤버는 <hash_map><hash_set> 헤더 파일이 더 이상 std 네임 스페이스에 있지만 오히려 stdext 네임 스페이스로 이동 되었습니다.자세한 내용은 stdext 네임스페이스를 참조하십시오.

예제

// hash_multiset_value_comp.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   
   hash_multiset <int, hash_compare < int, less<int> > > hms1;
   hash_multiset <int, hash_compare < int, less<int> > >::value_compare
      vc1 = hms1.value_comp( );
   bool result1 = vc1( 2, 3 );
   if( result1 == true )
   {
      cout << "vc1( 2,3 ) returns value of true, "
           << "where vc1 is the function object of hms1."
           << endl;
   }
   else
   {
      cout << "vc1( 2,3 ) returns value of false, "
           << "where vc1 is the function object of hms1."
           << endl;
   }

   hash_multiset <int, hash_compare < int, greater<int> > > hms2;
   hash_multiset<int, hash_compare < int, greater<int> > >::
           value_compare vc2 = hms2.value_comp( );
   bool result2 = vc2( 2, 3 );
   if( result2 == true )
   {
      cout << "vc2( 2,3 ) returns value of true, "
           << "where vc2 is the function object of hms2."
           << endl;
   }
   else
   {
      cout << "vc2( 2,3 ) returns value of false, "
           << "where vc2 is the function object of hms2."
           << endl;
   }
}
  
  

요구 사항

헤더: <hash_set>

네임 스페이스: stdext

참고 항목

참조

hash_multiset Class

표준 템플릿 라이브러리