bool empty() const; // C++03
bool empty() const noexcept; // C++11
[[nodiscard]] constexpr bool empty() const noexcept; // C++20
constexpr bool empty() const noexcept; // C++26
概要
文字列が空か判定する。
戻り値
size() == 0
の評価結果。
例外
投げない
例
出力
参照
- P0600R1
[[nodiscard]]
in the Library- C++20で
[[nodiscard]]
が付加された
- C++20で
- P0980R1 Making
std::string
constexpr- C++20で
constexpr
が付加された
- C++20で
- P2422R1 Remove
nodiscard
annotations from the standard library specification- C++26で
[[nodiscard]]
指定が削除された
- C++26で