다음을 통해 공유


hash_set::value_type

[!참고]

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

용량 값으로는 hash_set의 요소로 저장 된 개체를 설명 하는 형식입니다.

typedef Key value_type;

주석 처리

value_type템플릿 매개 변수에 대 한 동의어입니다 Key.

이때 두 key_typevalue_type 템플릿 매개 변수에 대 한 동의어는 .두 종류는 구분 되는, 지도 multimap 클래스와의 호환성에 대 한 동일 집합 및 hash_set 클래스를 제공 합니다.

에 대 한 자세한 내용은 Key, 설명 부분을 참조를 hash_set Class 항목.

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

예제

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

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1;
   hash_set <int>::iterator hs1_Iter;

   hash_set <int> :: value_type hsvt_Int;   // Declare value_type
   hsvt_Int = 10;             // Initialize value_type

   hash_set <int> :: key_type hskt_Int;   // Declare key_type
   hskt_Int = 20;             // Initialize key_type

   hs1.insert( hsvt_Int );         // Insert value into hs1
   hs1.insert( hskt_Int );         // Insert key into hs1

   // A hash_set accepts key_types or value_types as elements
   cout << "The hash_set has elements:";
   for ( hs1_Iter = hs1.begin( ) ; hs1_Iter != hs1.end( ); hs1_Iter++)
      cout << " " << *hs1_Iter;
   cout << "." << endl;
}
  

요구 사항

헤더: <hash_set>

네임 스페이스: stdext

참고 항목

참조

hash_set Class

표준 템플릿 라이브러리