std::inplace_vector<T,N>::size
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) |