Scroll to navigation

std::inplace_vector::empty(3) C++ Standard Libary std::inplace_vector::empty(3)

NAME

std::inplace_vector::empty - std::inplace_vector::empty

Synopsis

constexpr bool empty() const noexcept; (since C++26)

Checks if the container has no elements, i.e. whether begin() == end().

Parameters

(none)

Return value

true if the container is empty, false otherwise.

Complexity

Constant.

Example

// Run this code

#include <cassert> #include <inplace_vector>

int main() {
std::inplace_vector<char, 8> v;
assert(v.empty());


v.push_back('_');
assert(not v.empty()); }

See also

size returns the number of elements
(public member function) empty checks whether the container is empty (C++17) (function template)

2026.11.10 http://cppreference.com