std::inplace_vector<T,N>::size
ja.cppreference.net より
constexpr size_type size() const;
|
(C++26以降) | |
コンテナ内の要素数、すなわち std::distance(begin(), end()) を返します。
戻り値
std:: distance ( begin ( ) , end ( ) )
計算量
定数。
例
このコードを実行
#include <cassert> #include <inplace_vector> int main() { std::inplace_vector<int, 4> nums; assert(nums.size() == 0); nums = {1, 2, 3, 4}; assert(nums.size() == 4); }
関連項目
|
[static]
|
現在割り当てられているストレージに保持できる要素数を返す
(public static member function) |
|
コンテナが空かどうかをチェックする
(public member function) |
|
|
[static]
|
可能な最大要素数を返す
(public static member function) |
|
格納されている要素数を変更する
(public member function) |
|
|
(C++17)
(C++20)
|
コンテナまたは配列のサイズを返す
(function template) |