Sdílet prostřednictvím


hash_multiset::hash_multiset (STL/CLR)

Vytvoří objekt kontejneru.

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

Parametry

  • první
    Začátek rozsahu vložit.

  • hashfn
    Hash funkce pro mapování kláves do bloků.

  • poslední
    Konec rozsahu vložit.

  • Před
    Predikát pro řízené posloupnost řazení.

  • pravý
    Objekt nebo oblast pro vložení.

Poznámky

Konstruktor:

hash_multiset();

Inicializuje řízené sekvenci bez prvků pomocí výchozí řazení predikát key_compare()a s výchozí funkce hash.Použijte prázdný počáteční řízené sekvenci, určit výchozí predikát a hash funkce řazení.

Konstruktor:

explicit hash_multiset(key_compare^ pred);

Inicializuje řízené sekvenci bez prvků s objednávání predikát preda s výchozí funkce hash.Pomocí zadání prázdné počáteční řízené sekvenci, pomocí zadané predikátu řazení a výchozí funkce hash.

Konstruktor:

hash_multiset(key_compare^ pred, hasher^ hashfn);

Inicializuje řízené sekvenci bez prvků s objednávání predikát preda s transformační funkcí hashfn.Použít k určení prázdné počáteční řízené sekvenci, s zadaný řazení predikátu a hash funkce.

Konstruktor:

hash_multiset(hash_multiset<Key>% right);

Inicializuje řízené sekvenci s pořadí [right.hash_multiset::begin (STL/CLR)(), right.hash_multiset::end (STL/CLR)()), s výchozí řazení predikát a výchozí funkce hash.Použít jej k určení počáteční řízené sekvenci, která je kopií sekvence řízena objektem hash_multiset right, s výchozí řazení predikát a funkce hash.

Konstruktor:

hash_multiset(hash_multiset<Key>^ right);

Inicializuje řízené sekvenci s pořadí [right->hash_multiset::begin (STL/CLR)(), right->hash_multiset::end (STL/CLR)()), s výchozí řazení predikát a výchozí funkce hash.Použít jej k určení počáteční řízené sekvenci, která je kopií sekvence řízena objektem hash_multiset right, s výchozí řazení predikát a funkce hash.

Konstruktor:

template<typename InIter>

hash_multiset(InIter first, InIter last);

Inicializuje řízené sekvenci s pořadí [first, last), s výchozí řazení predikát a výchozí funkce hash.Použijete ji k vytvoření kopie jiného pořadí řízené sekvenci s výchozí predikát a hash funkce řazení.

Konstruktor:

template<typename InIter>

hash_multiset(InIter first, InIter last,

key_compare^ pred);

Inicializuje řízené sekvenci s pořadí [first, last), s objednávání predikát preda s výchozí funkce hash.Použijete ji k vytvoření kopie jiného sekvence s zadané predikátu řazení a výchozí hodnoty hash funkce řízené sekvenci.

Konstruktor:

template<typename InIter>

hash_multiset(InIter first, InIter last,

key_compare^ pred, hasher^ hashfn);

Inicializuje řízené sekvenci s pořadí [first, last), s objednávání predikát preda s transformační funkcí hashfn.Použijete ji k vytvoření kopie jiného sekvence s zadaný řazení predikátu a hash funkce řízené sekvenci.

Konstruktor:

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

Inicializuje řízené sekvenci s pomocí enumerátoru určeného pořadí right, s výchozí řazení predikát a výchozí funkce hash.Použijete ji k vytvoření kopie jiného sekvence popsané enumerátor, výchozí řazení predikátu a hash funkce řízené sekvenci.

Konstruktor:

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

key_compare^ pred);

Inicializuje řízené sekvenci s pomocí enumerátoru určeného pořadí right, s objednávání predikát preda s výchozí funkce hash.Použijete ji k vytvoření kopie jiného sekvence popsané čítač výčtu zadaný řazení predikátu a výchozí hodnoty hash funkce řízené sekvenci.

Konstruktor:

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

key_compare^ pred, hasher^ hashfn);

Inicializuje řízené sekvenci s pomocí enumerátoru určeného pořadí right, s objednávání predikát preda s transformační funkcí hashfn.Použijete ji k vytvoření kopie jiného sekvence popsané čítač výčtu zadaný řazení predikátu a hash funkce řízené sekvenci.

Příklad

// cliext_hash_multiset_construct.cpp 
// compile with: /clr 
#include <cliext/hash_set> 
 
int myfun(wchar_t key) 
    { // hash a key 
    return (key ^ 0xdeadbeef); 
    } 
 
typedef cliext::hash_multiset<wchar_t> Myhash_multiset; 
int main() 
    { 
// construct an empty container 
    Myhash_multiset 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_multiset 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_multiset c2h(cliext::greater_equal<wchar_t>(), 
        gcnew Myhash_multiset::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_multiset 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_multiset 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_multiset c4h(c1.begin(), c1.end(), 
        cliext::greater_equal<wchar_t>(), 
        gcnew Myhash_multiset::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_multiset 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_multiset 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_multiset c6h(   // NOTE: cast is not needed 
        (System::Collections::Generic::IEnumerable<wchar_t>^)%c3, 
            cliext::greater_equal<wchar_t>(), 
                gcnew Myhash_multiset::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_multiset c7(c4); 
    for each (wchar_t elem in c7) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct by copying another container 
    Myhash_multiset c8(%c3); 
    for each (wchar_t elem in c8) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

Požadavky

Záhlaví:<cliext/hash_set>

Obor názvů: cliext

Viz také

Referenční dokumentace

hash_multiset (STL/CLR)

hash_multiset::generic_container (STL/CLR)

hash_multiset::operator= (STL/CLR)