◐ Shell
clean mode source ↗

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

来自cppreference.com

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

检查容器是否无元素,即是否 begin() == end()

返回值

若容器为空则为 true,否则为 false

复杂度

常数。

示例

#include <cassert>
#include <inplace_vector>

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

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

参阅