다음을 통해 공유


hash_multiset::operator=

참고

이 API는 사용되지 않습니다.unordered_multiset 클래스를 대신 사용하는 것이 좋습니다.

Replaces the elements of the hash_multiset with a copy of another hash_multiset.

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

매개 변수

Parameter

설명

_Right

The hash_multiset 클래스 being copied into the hash_multiset.

설명

After erasing any existing elements in a hash_multiset, operator= either copies or moves the contents of _Right into the hash_multiset.

예제

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

요구 사항

헤더: <hash_set>

네임스페이스: std

참고 항목

참조

hash_multiset 클래스

표준 템플릿 라이브러리