Condividi tramite


hash_multiset::operator=

[!NOTA]

Questo API è obsoleto.L'alternativa consiste unordered_multiset Class.

Sostituisce gli elementi di hash_multiset con una copia di un altro hash_multiset.

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

Parametri

Parametro

Descrizione

_Right

hash_multiset Class copiato in hash_multiset.

Note

Dopo l'eliminazione di tutti gli elementi esistenti in hash_multiset, operator= copiare o spostare il contenuto _Right in hash_multiset.

Esempio

// 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;
}

Output

v1 = 10 
v2 = 10 
v2 = 10 

Requisiti

intestazione: <hash_set>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

hash_multiset Class

Libreria di modelli standard