Udostępnij za pośrednictwem


hash_multimap::operator=

[!UWAGA]

Ten interfejs API jest nieaktualny.Alternatywą jest unordered_multimap — Klasa.

Zastępuje elementy hash_multimap z kopią innego hash_multimap.

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

Parametry

Parametr

Opis

_Right

hash_multimap — Klasa Są kopiowane do hash_multimap.

Uwagi

Po skasowaniu wszelkich istniejących elementów w hash_multimap, operator= albo kopiuje lub przenosi zawartość _Right do hash_multimap.

Przykład

// hash_multimap_operator_as.cpp
// compile with: /EHsc
#include <hash_multimap>
#include <iostream>

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

   v1.insert(pair<int, int>(1, 10));

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

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

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

Dane wyjściowe

v1 = 10 
v2 = 10 
v2 = 10 

Wymagania

Nagłówek: <hash_map>

Przestrzeń nazw: std

Zobacz też

Informacje

hash_multimap — Klasa

Standardowa biblioteka szablonów