std::predicate(3)
okay bestie, welcome to the std::predicate(3) page from the C++ Standard Libary (yes, that's the header spelling, love that for us) β the manual name is right there at the top, no cap. Let's get into the vibe check. πβ¨
π NAME π
std::predicate-std::predicate(literally the name and the one-liner, iconic).
β¨ Synopsis β¨
Defined in header <concepts>.
template< class F, class... Args >
concept predicate = (since
C++20)
std::regular_invocable<F, Args...> &&
boolean-testable<std::invoke_result_t<F, Args...>>;
That (since C++20) annotation means this concept is since C++20, slay. π«Ά
So the concept std::predicate<F, Args...> specifies that F is a predicate that accepts arguments whose types and value categories are encoded by Args... β i.e., it can be invoked with these arguments to produce a boolean-testable result. That's the whole main character energy of this page. π
Important note, bestie: regular_invocable requires the invocation to not modify either the callable object or the arguments and be equality-preserving. No sneaky mutations, fr fr. π
π Equality preservation π
Okay so equality preservation: Expressions declared in requires expressions of the standard library concepts are required to be equality-preserving (except where stated otherwise). That's the rule, iykyk. π¦
This gem came from cppreference.com, version 2024.06.10, and it's the std::predicate(3) page β mwah, bye bestie! ππΈ
π¦ 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