public member function
<array>
std::array::empty
constexpr bool empty() noexcept;
Test whether array is empty
This function does not modify the content of the array in any way. To clear the content of an array object, use array::fill.
Parameters
noneReturn Value
true if the array size is 0, false otherwise.This is a constexpr.
Example
|
|
Output:
first is empty second is not empty
Complexity
Constant.Iterator validity
No changes.Data races
No contained elements are accessed: concurrently accessing or modifying them is safe.Exception safety
No-throw guarantee: this member function never throws exceptions.See also
- array::fill
- Fill array with value (public member function)
- array::size
- Return size (public member function)