名前空間
変種
操作

std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::size

From cppreference.com
 
 
 
 
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 メンバ関数) [編集]
(C++17)(C++20)
コンテナまたは配列のサイズを返す
(関数テンプレート) [編集]
可能な最大要素数を返す
(public メンバ関数) [編集]
English 日本語 中文(简体) 中文(繁體)