hash_set::hash_set (STL/CLR)

컨테이너 개체를 만듭니다.

    hash_set();
    explicit hash_set(key_compare^ pred);
    hash_set(key_compare^ pred, hasher^ hashfn);
    hash_set(hash_set<Key>% right);
    hash_set(hash_set<Key>^ right);
    template<typename InIter>
        hash_sethash_set(InIter first, InIter last);
    template<typename InIter>
        hash_set(InIter first, InIter last,
            key_compare^ pred);
    template<typename InIter>
        hash_set(InIter first, InIter last,
            key_compare^ pred, hasher^ hashfn);
    hash_set(System::Collections::Generic::IEnumerable<GValue>^ right);
    hash_set(System::Collections::Generic::IEnumerable<GValue>^ right,
        key_compare^ pred);
    hash_set(System::Collections::Generic::IEnumerable<GValue>^ right,
        key_compare^ pred, hasher^ hashfn);

매개 변수

  • 첫 번째
    삽입할 범위의 시작 부분입니다.

  • hashfn
    함수 매핑 키 버킷과 대 한 해시입니다.

  • last
    삽입 범위 끝입니다.

  • pred
    제어 되는 시퀀스에 대해 조건자를 순서입니다.

  • right
    개체 또는 셀 범위를 삽입 합니다.

설명

생성자:

hash_set();

제어 되는 시퀀스에 요소가 없으면 조건자 순서 기본 초기화 key_compare(), 및 기본 해시 함수를 사용 합니다.조건자 및 해시 함수 순서 기본 빈 초기 제어 된 시퀀스를 지정 하려면 사용 합니다.

생성자:

explicit hash_set(key_compare^ pred);

주문 조건자에 요소가 없으면 제어 되는 시퀀스를 초기화 pred, 및 기본 해시 함수를 사용 합니다.주문 지정한 조건자 및 기본 해시 함수에 빈 초기 제어 된 시퀀스를 지정 하려면 사용 합니다.

생성자:

hash_set(key_compare^ pred, hasher^ hashfn);

제어 되는 시퀀스 순서를 지정 하는 조건자에 요소가 없으면 초기화 pred, 해시 함수를 사용 하 고 hashfn.지정한 주문 조건자와 해시 함수에 빈 초기 제어 된 시퀀스를 지정 하려면 사용 합니다.

생성자:

hash_set(hash_set<Key>% right);

제어 되는 시퀀스의 시퀀스를 초기화 [right.hash_set::begin (STL/CLR)(), right.hash_set::end (STL/CLR)()), 조건자를 순서 기본값 및 기본 해시 함수입니다.지정 된 hash_set 개체에 의해 제어 되는 시퀀스의 복사본은 초기 제어 되는 시퀀스를 사용 하 여 right, 기본 주문 조건자와 해시 함수입니다.

생성자:

hash_set(hash_set<Key>^ right);

제어 되는 시퀀스의 시퀀스를 초기화 [right->hash_set::begin (STL/CLR)(), right->hash_set::end (STL/CLR)()), 조건자를 순서 기본값 및 기본 해시 함수입니다.지정 된 hash_set 개체에 의해 제어 되는 시퀀스의 복사본은 초기 제어 되는 시퀀스를 사용 하 여 right, 기본 주문 조건자와 해시 함수입니다.

생성자:

template<typename InIter>

hash_set(InIter first, InIter last);

제어 되는 시퀀스의 시퀀스를 초기화 [first, last), 조건자를 순서 기본값 및 기본 해시 함수입니다.제어 되는 시퀀스를 다른 시퀀스의 조건자와 해시 함수 순서 기본 복사본을 사용 합니다.

생성자:

template<typename InIter>

hash_set(InIter first, InIter last,

key_compare^ pred);

제어 되는 시퀀스의 시퀀스를 초기화 [first, last), 주문 조건자와 pred, 및 기본 해시 함수를 사용 합니다.제어 되는 시퀀스는 기본 해시 함수의 순서 지정 된 조건자와 다른 시퀀스의 복사본을 사용 합니다.

생성자:

template<typename InIter>

hash_set(InIter first, InIter last,

key_compare^ pred, hasher^ hashfn);

제어 되는 시퀀스의 시퀀스를 초기화 [first, last), 주문 조건자와 pred, 해시 함수를 사용 하 고 hashfn.제어 되는 시퀀스는 지정한 정렬 조건자와 해시 함수에 다른 시퀀스의 복사본을 사용 합니다.

생성자:

hash_set(System::Collections::Generic::IEnumerable<Key>^ right);

제어 되는 시퀀스 된 열거자에서 지정 시퀀스가 초기화 right, 조건자를 순서 기본값 및 기본 해시 함수입니다.제어 되는 시퀀스는 조건자와 해시 함수 순서 기본 열거형에서 설명 하는 다른 시퀀스의 복사본을 사용 합니다.

생성자:

hash_set(System::Collections::Generic::IEnumerable<Key>^ right,

key_compare^ pred);

열거자에서 지정 하는 순서를 제어 되는 시퀀스를 초기화 right, 주문 조건자와 pred, 및 기본 해시 함수를 사용 합니다.제어 되는 시퀀스는 지정한 정렬 조건자와 기본 해시 함수 열거자에서 설명한 다른 시퀀스의 복사본을 사용 합니다.

생성자:

hash_set(System::Collections::Generic::IEnumerable<Key>^ right,

key_compare^ pred, hasher^ hashfn);

열거자에서 지정 하는 순서를 제어 되는 시퀀스를 초기화 right, 주문 조건자와 pred, 해시 함수를 사용 하 고 hashfn.제어 되는 시퀀스는 지정한 정렬 조건자와 해시 함수에는 열거자가 설명 하는 다른 시퀀스의 복사본을 사용 합니다.

예제

// cliext_hash_set_construct.cpp 
// compile with: /clr 
#include <cliext/hash_set> 
 
int myfun(wchar_t key) 
    { // hash a key 
    return (key ^ 0xdeadbeef); 
    } 
 
typedef cliext::hash_set<wchar_t> Myhash_set; 
int main() 
    { 
// construct an empty container 
    Myhash_set c1; 
    System::Console::WriteLine("size() = {0}", c1.size()); 
 
    c1.insert(L'a'); 
    c1.insert(L'b'); 
    c1.insert(L'c'); 
    for each (wchar_t elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an ordering rule 
    Myhash_set c2 = cliext::greater_equal<wchar_t>(); 
    System::Console::WriteLine("size() = {0}", c2.size()); 
 
    c2.insert(c1.begin(), c1.end()); 
    for each (wchar_t elem in c2) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an ordering rule and hash function 
    Myhash_set c2h(cliext::greater_equal<wchar_t>(), 
        gcnew Myhash_set::hasher(&myfun)); 
    System::Console::WriteLine("size() = {0}", c2h.size()); 
 
    c2h.insert(c1.begin(), c1.end()); 
    for each (wchar_t elem in c2h) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    System::Console::WriteLine(); 
 
// construct with an iterator range 
    Myhash_set c3(c1.begin(), c1.end()); 
    for each (wchar_t elem in c3) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an iterator range and an ordering rule 
    Myhash_set c4(c1.begin(), c1.end(), 
        cliext::greater_equal<wchar_t>()); 
    for each (wchar_t elem in c4) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an iterator range and an ordering rule and hash function 
    Myhash_set c4h(c1.begin(), c1.end(), 
        cliext::greater_equal<wchar_t>(), 
        gcnew Myhash_set::hasher(&myfun)); 
    for each (wchar_t elem in c4h) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    System::Console::WriteLine(); 
 
// construct with an enumeration 
    Myhash_set c5(   // NOTE: cast is not needed 
        (System::Collections::Generic::IEnumerable<wchar_t>^)%c3); 
    for each (wchar_t elem in c5) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an enumeration and an ordering rule 
    Myhash_set c6(   // NOTE: cast is not needed 
        (System::Collections::Generic::IEnumerable<wchar_t>^)%c3, 
            cliext::greater_equal<wchar_t>()); 
    for each (wchar_t elem in c6) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an enumeration and an ordering rule and hash function 
    Myhash_set c6h(   // NOTE: cast is not needed 
        (System::Collections::Generic::IEnumerable<wchar_t>^)%c3, 
            cliext::greater_equal<wchar_t>(), 
                gcnew Myhash_set::hasher(&myfun)); 
    for each (wchar_t elem in c6h) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    System::Console::WriteLine(); 
 
// construct from a generic container 
    Myhash_set c7(c4); 
    for each (wchar_t elem in c7) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct by copying another container 
    Myhash_set c8(%c3); 
    for each (wchar_t elem in c8) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/hash_set >

네임 스페이스: cliext

참고 항목

참조

hash_set (STL/CLR)

hash_set::generic_container (STL/CLR)

hash_set::operator= (STL/CLR)