最終更新日時(UTC):
が更新

履歴 編集

function
<inplace_vector>

std::inplace_vector::empty(C++26)

constexpr bool empty() const noexcept; // (1) C++26

概要

コンテナが空かどうかを判定する。

戻り値

コンテナが空であればtrue、そうでなければfalseを返す。

例外

投げない

計算量

定数時間

#include <print>
#include <inplace_vector>

int main()
{
  std::inplace_vector<int, 5> iv;
  std::println("{}", iv.empty());

  iv.push_back(1);
  std::println("{}", iv.empty());
}

出力

true
false

バージョン

言語

  • C++26

処理系

参照