A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../../cpp/../cpp/container/inplace_vector/pop_back.html below:

std::inplace_vector<T,N>::pop_back - cppreference.com

constexpr void pop_back();

Removes the last element of the container.

If empty() is true:

Iterators and references to the last element are invalidated. The end() iterator is also invalidated.

[edit] Complexity

Constant.

[edit] Example
#include <inplace_vector>
#include <print>
 
int main()
{
    std::inplace_vector<int, 4> numbers{1, 2, 3};
    for (; not numbers.empty(); numbers.pop_back())
        std::println("{}", numbers);
}

Output:

[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4