名前空間
変種
操作

std::array::size

提供: cppreference.com
< cpp‎ | container‎ | array

 
 
 
std::array
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
要素アクセスの循環参照を解除するために使用されている
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::at
array::operator[]
array::front
array::back
array::data
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::begin
array::cbegin
array::end
array::cend
array::rbegin
array::crbegin
array::rend
array::crend
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::empty
array::size
array::max_size
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::fill
array::swap
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get
swap
ヘルパークラス
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tuple_size
tuple_element
 
constexpr size_type size()
(C + + 11以来)

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

目次

[編集] パラメータ

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

コンテナ内の要素の数
Original:
the number of elements in the container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

noexcept specification:  
noexcept
  (C + + 11以来)

[編集] 複雑

Constant

[編集]

The following code uses size to display the number of elements in a std::array<int>:

#include <array>
#include <iostream>
 
int main()
{
    std::array<int> nums {1, 3, 5, 7};
 
    std::cout << "nums contains " << nums.size() << " elements.\n";
}

Output:

nums contains 4 elements.

[編集] も参照してください

コンテナが空であるかどうかをチェックします
(パブリックメンバ関数) [edit]
要素の最大数を返します
Original:
returns the maximum possible number of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]