命名空间
变体
操作

std::flat_multiset<Key,Compare,KeyContainer>::size

来自 cppreference.cn
 
 
 
 
size_type size() const noexcept;
(自 C++23 起)

返回容器适配器中元素的数量。等价于: return c.size()

目录

[编辑] 参数

(无)

[编辑] 返回值

容器适配器中元素的数量。

[编辑] 复杂度

常数。

[编辑] 示例

#include <cassert>
#include <flat_set>
 
int main()
{
    std::flat_multiset<int> nums{4, 2, 4, 2};
    assert(nums.size() == 4);
}

[编辑] 参见

检查容器适配器是否为空
(public member function) [编辑]
(C++17)(C++20)
返回容器或数组的大小
(function template) [编辑]
返回可能的最大元素数量
(public member function) [编辑]