[[nodiscard]] constexpr bool empty() const noexcept; // (1) C++20
constexpr bool empty() const noexcept; // (1) C++26
概要
参照している範囲が空かどうかを判定する。
戻り値
以下と等価:
return size() == 0;
例外
投げない
計算量
定数時間
例
出力
バージョン
言語
- C++20
処理系
- Clang: 9.0 ✅
- GCC: ??
- Visual C++: ??
参照
- P2422R1 Remove
nodiscard
annotations from the standard library specification- C++26で
[[nodiscard]]
指定が削除された
- C++26で