Sdílet prostřednictvím


hash_multiset::operator=

[!POZNÁMKA]

Toto rozhraní API je zastaralé.Alternativou je unordered_multiset – třída.

Prvky hash_multiset nahradí kopie jiného hash_multiset.

hash_multiset& operator=(
   const hash_multiset& _Right
);
hash_multiset& operator=(
   hash_multiset&& _Right
);

Parametry

Parametr

Popis

_Right

hash_multiset – třída Kopírované do hash_multiset.

Poznámky

Po smazání všech existujících prvků v hash_multiset, operator= zkopíruje nebo přesune obsah _Right do hash_multiset.

Příklad

// hash_multiset_operator_as.cpp
// compile with: /EHsc
#include <hash_multiset>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multiset<int> v1, v2, v3;
   hash_multiset<int>::iterator iter;

   v1.insert(10);

   cout << "v1 = " ;
   for (iter = v1.begin(); iter != v1.end(); iter++)
      cout << iter << " ";
   cout << endl;

   v2 = v1;
   cout << "v2 = ";
   for (iter = v2.begin(); iter != v2.end(); iter++)
      cout << iter << " ";
   cout << endl;

// move v1 into v2
   v2.clear();
   v2 = move(v1);
   cout << "v2 = ";
   for (iter = v2.begin(); iter != v2.end(); iter++)
      cout << iter << " ";
   cout << endl;
}

Výsledek

v1 = 10 
v2 = 10 
v2 = 10 

Požadavky

Záhlaví:<hash_set>

Obor názvů: std

Viz také

Referenční dokumentace

hash_multiset – třída

Standardní knihovna šablon