Namespaces
Variants

std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>:: swap

From cppreference.net

void swap ( flat_map & other ) noexcept ;
(自 C++23 起)
Exchanges the contents of the container adaptor with those of other . Effectively calls
ranges::swap(compare, other.compare);
ranges::swap(c.keys, other.c.keys);
ranges::swap(c.values, other.c.values);
(注:根据要求,代码块内的C++代码内容未进行翻译,仅添加了中文注释说明)

目录

参数

其他 - 容器适配器,用于交换内容

返回值

(无)

异常

(无)

复杂度

与底层容器相同(通常为常量)。

示例

参见

特化 std::swap 算法
(函数模板)