다음을 통해 공유


hash_set::operator=

[!참고]

이 API는 사용되지 않습니다.대신 unordered_set Class.

Hash_set의 요소를 다른 hash_set의 복사본으로 대체합니다.

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

매개 변수

Parameter

설명

_Right

hash_set Class 로 복사 되는 hash_set.

설명

지우기 모든 기존 요소 뒤에 hash_set, operator= 의 내용을 이동 하거나 복사 _Right 에 hash_set.

예제

// hash_set_operator_as.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_set<int> v1, v2, v3;
   hash_set<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_set Class

표준 템플릿 라이브러리