다음을 통해 공유


swap(hash_set)

참고

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

Exchanges the elements of two hash_sets.

void swap(
   hash_set <Key, Traits, Allocator>& _Left,
   hash_set <Key, Traits, Allocator>& _Right
);

매개 변수

  • _Right
    The hash_set providing the elements to be swapped, or the hash_set whose elements are to be exchanged with those of the hash_set _Left.

  • _Left
    The hash_set whose elements are to be exchanged with those of the hash_set _Right.

설명

The swap template function is an algorithm specialized on the container class hash_set to execute the member function _Left.swap(_Right). This is an instance of the partial ordering of function templates by the compiler. 템플릿 함수가 함수 호출이 있는 템플릿 일치가 고유하지 않게 초과 로드되면 컴파일러는 템플릿 함수의 가장 특수화된 버전을 선택합니다. The general version of the template function

template <class T> void swap(T&, T&),

in the algorithm class works by assignment and is a slow operation. 각 컨테이너에 있는 특수화된 버전은 컨테이너 클래스의 내부 표현을 사용하여 작업할 수 있는 것만큼 훨씬 빠릅니다.

Visual C++.NET 2003에서, <hash_map><hash_set> 헤더 파일의 멤버는 더 이상 std 네임스페이스에 존재하지 않습니다. 대신 stdext 네임스페이스로 이동되었습니다. 자세한 내용은 stdext 네임스페이스를 참조하십시오.

예제

See the code example for the member class hash_set::swap for an example that uses the template version of swap.

요구 사항

헤더: <hash_set>

네임스페이스: stdext

참고 항목

참조

표준 템플릿 라이브러리