命名空间
变体
操作

operator==, <=> (std::flat_map)

来自 cppreference.cn
< cpp‎ | 容器‎ | flat map
 
 
 
 
friend bool operator==( const std::flat_map& lhs,
                        const std::flat_map& rhs );
(1) (C++23 起)
friend synth-three-way-result<value_type>

    operator<=>( const std::flat_map& lhs,

                 const std::flat_map& rhs );
(2) (C++23 起)
比较两个容器适配器底层容器的内容。比较是通过将相应的运算符应用于底层容器来完成的。

目录

[编辑] 参数

lhs, rhs - 要比较其内容的容器适配器

[编辑] 返回值

1) 如果对应的比较结果为 true 则返回 true,否则返回 false
2) 基础容器的三路比较结果。

[编辑] 复杂度

1) 如果 lhsrhs 的大小不同,则为常数时间,否则与 flat_map 的大小成线性关系。
2) 与容器大小呈线性关系。

[编辑] 示例