std::indire...le_storable(3)

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

πŸ’… NAME πŸ’…

std::indirectly_movable_storable β€” bestie, that's literally the name, std::indirectly_movable_storable

Ok so real talk, this page comes from the C++ Standard Libary manual (yes that's how it's spelled on the tin, no I will not be fixing it, it's iconic) β€” and it's std::indire...le_storable(3) in the corner, they truncated it because the name is a whole paragraph, honestly relatable 😭


✨ SYNOPSIS ✨

Defined in header <iterator>:

template< class In, class Out >

concept indirectly_movable_storable =
    std::indirectly_movable<In, Out> &&
    std::indirectly_writable<Out, std::iter_value_t<In>> &&
    std::movable<std::iter_value_t<In>> &&
    std::constructible_from<std::iter_value_t<In>,
std::iter_rvalue_reference_t<In>> &&
    std::assignable_from<std::iter_value_t<In>&,
std::iter_rvalue_reference_t<In>>;

Since C++20 btw πŸ’–

So the indirectly_movable_storable concept is out here defining the whole situationship between an indirectly_readable type and an indirectly_writable type. On top of what indirectly_movable already asks for, this one also specifies that the move from the indirectly_readable type can be performed via an intermediate object. Like, you don't just yeet the value directly β€” there's a little middleman obj and it's doing main character work 🫢

🌸 Semantic requirements 🌸

In and Out model std::indirectly_movable_storable<In, Out> only if, given a dereferenceable value i of type In:

  • After the definition std::iter_value_t<In> obj(ranges::iter_move(i));, obj is equal to the value previously denoted by *i, and
  • if std::iter_rvalue_reference_t<In> is an rvalue reference type, *i is placed in a valid but unspecified state after the initialization of obj.
Not me emphasizing valid but unspecified β€” that's the whole point, bestie. It's alive, it's legal, it's just... going through something πŸ’€

πŸ¦‹ Equality preservation πŸ¦‹

Expressions declared in requires expressions of the standard library concepts are required to be equality-preserving (except where stated otherwise).


πŸŽ€ SEE ALSO πŸŽ€

  • indirectly_movable (C++20) β€” specifies that values may be moved from an indirectly_readable type to an indirectly_writable type (concept)
  • indirectly_copyable_storable (C++20) β€” specifies that values may be copied from an indirectly_readable type to an indirectly_writable type and that the copy may be performed via an intermediate object (concept)

periodt. that's the whole page, no cap πŸ’œ

Source: http://cppreference.com β€” version 2024.06.10 β€” page std::indire...le_storable(3). Go drink some water and then go model some concepts, bestie πŸ“βœ¨

πŸ“¦ where this page comes from