名前空間
変種
操作

std::array::empty

提供: 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 bool empty();
(C++11およびそれ以降)
小切手コンテナに要素がない場合、すなわちかどうかbegin() == end().
Original:
Checks if the container has no elements, i.e. whether begin() == end().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

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

[編集] 値を返します

true容器が空であれば、そうでなければfalse
Original:
true if the container is empty, false otherwise
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およびそれ以降)

[編集] 複雑

定数
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

次のコードは、emptyに要素が含まれているかどうかをチェックするためにstd::array<int>使用しています
Original:
The following code uses empty to check if a std::array<int> contains any elements:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <array>
#include <iostream>
 
int main()
{
    std::array<int, 4> numbers {3, 1, 4, 1};
    std::array<int, 0> no_numbers;
 
    std::cout << "numbers.empty(): " << numbers.empty() << '\n';
    std::cout << "no_numbers.empty(): " << no_numbers.empty() << '\n';
}

Output:

numbers.empty(): 0
no_numbers.empty(): 1

See also

要素数を返します
Original:
returns the 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]