std::match_results::empty(3)
okay so bestie, welcome to std::match_results::empty(3) from the C++ Standard Libary β yes, thatβs the manual name in the header, spelling and all, and we are not touching it. This one is short and iconic: itβs basically the vibe check for whether a match actually matched. β¨
πΈ NAME πΈ
std::match_results::empty β std::match_results::empty (the name said it twice, and honestly? slay.)
β¨ Synopsis β¨
bool empty() const; (since C++11)
(until C++20)
[[nodiscard]] bool empty() const; (since C++20)
Checks whether the match was successful. Thatβs the whole assignment, no cap. π―
π Parameters π
(none) β literally zero parameters, not even a tiny one. π
π Return value π
It gives you true if *this represents the result of a failed match, and false otherwise, i.e. size() == 0. So yes: failed-match energy gets true, and everything else gets false. π
π Exceptions π
May throw implementation-defined exceptions. So like, itβs not contractually chill 100% of the time β the implementation gets to define its own chaos. π
β‘ Complexity β‘
Constant. Thatβs it. No dramatic runtime arc. π
π See also π
sizeβ returns the number of matches in a fully-established result state (public member function).
xoxo, your source is http://cppreference.com, dated 2024.06.10 β mwah π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms