std::indire...ry_predicate(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so bestie, we are in the C++ Standard Libary manual (yes, spelled like that in the header β€” we keep the lore) and this is the page for std::indirect_unary_predicate. The NAME line is literally std::indirect_unary_predicate - std::indirect_unary_predicate β€” yes, it said it twice, and honestly? iconic. πŸ’…βœ¨

🌸 Synopsis 🌸

Defined in header <iterator> πŸ¦‹

template< class F, class I >

concept indirect_unary_predicate =
    std::indirectly_readable<I> &&
    std::copy_constructible<F> &&                         (since
C++20)
    std::predicate<F&, std::iter_value_t<I>&> &&
    std::predicate<F&, std::iter_reference_t<I>> &&

    std::predicate<F&, std::iter_common_reference_t<I>>;

This one is since C++20, and it's giving β€œrequirements era” in the best way. πŸ’–

So indirect_unary_predicate specifies requirements for algorithms that call unary predicates as their arguments. That's its whole job. ✨

The key difference between this concept and std::predicate is that it is applied to the type that I references, rather than I itself. Lowkey the entire plot twist. πŸ‘‘

🧚 Semantic requirements 🧚

F and I model indirect_unary_predicate only if all concepts it subsumes are modeled. That's it, that's the semantic vibe check β€” no skipping the subsumed concepts, bestie. 🫢


cute sign-off: source http://cppreference.com, version/date 2024.06.10, page tag std::indire...ry_predicate(3). ty for reading, mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from