flat_multimap_swap

flat_multimap_swap (std::flat_multimap::swap — 내용 교환)

std::flat_multimap 하나의 내용을 다른 객체 other와 맞바꾸는 멤버 함수예요. 비교자와 두 내부 컨테이너(키·매핑값)를 모두 교환해요.

출처: cppreference

본문

시그니처는 다음과 같아요.

void swap( flat_multimap& other ) noexcept;   // (since C++23)

컨테이너 어댑터의 내용을 other의 내용과 교환해요. 내부적으로 다음과 같은 호출을 수행해요.

ranges::swap(compare, other.compare);
ranges::swap(c.keys, other.c.keys);
ranges::swap(c.values, other.c.values);

매개변수

  • other: 내용을 교환할 컨테이너 어댑터

복잡도

내부 컨테이너와 같아요(보통 상수).

함께 보기

  • std::swap(std::flat_multimap): std::swap 알고리즘을 특수화해요 (함수 템플릿, C++23)

더 알아보기 (Learn more)

cppreference