std::flat_set<Key,Compare,KeyContainer>::size
From cppreference.com
| size_type size() const noexcept; |
(C++23から) | |
コンテナアダプタ内の要素数を返します。次のコードと同等です: return c.size()。
目次 |
[ 編集 ] パラメータ
(なし)
[ 編集 ] 戻り値
コンテナアダプタ内の要素数。
[ 編集 ] 計算量
定数。
[ 編集 ] 例
このコードを実行
#include <cassert> #include <flat_set> int main() { std::flat_set<int> nums{4, 2, 4, 2}; assert(nums.size() == 2); }
[ 編集 ] 関連項目
| コンテナアダプタが空かどうかをチェックする (public メンバ関数) | |
| (C++17)(C++20) |
コンテナまたは配列のサイズを返す (関数テンプレート) |
| 可能な最大要素数を返す (public メンバ関数) |