std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::size
来自 cppreference.cn
< cpp | 容器 | flat_multimap
size_type size() const noexcept; |
(C++23 起) | |
返回容器适配器中元素的数量。等价于:return
c
.keys.size()。
目录 |
[编辑] 参数
(无)
[编辑] 返回值
容器适配器中的元素数量。
[编辑] 复杂度
常数时间。
[编辑] 示例
运行此代码
#include <cassert> #include <flat_map> int main() { std::flat_multimap<int, char> nums{{1, 'a'}, {1, 'b'}, {2, 'c'}, {2, 'd'}}; assert(nums.size() == 4); }
[编辑] 参阅
检查容器适配器是否为空 (public member function) | |
(C++17)(C++20) |
返回容器或数组的大小 (function template) |
返回元素的最大可能数量 (public member function) |