User:T. Canens/ranges notes
From cppreference.com
- Qualification style:
ranges::fooandstd::foo.- Exception: for something in std, spell out the full
std::experimental::ranges::foo
- Exception: for something in std, spell out the full
- Decide on where/how to decompose complex concepts (
Sortablebeing an example):- Template transcluded on each algorithm page using it?
- Note on the concept's page?
- Goal: A user shouldn't have to click on more than a couple of links to figure out what
Thas to satisfy in order to useranges::sorton astd::vector<T>.
- Cover [concepts.lib.general.equality] somewhere.
- Key points: equality preservation; which inputs may be modified; implicit expression variants
- Decide how to cover them.
- Template and transclude on every concept page that is relevant?
- Dedicated section + links?
- Algorithms.
- May need a template for the "return the past-the-end iterator of the range" thing.
- Document various caveats in remarks? (But note https://github.com/ericniebler/stl2/issues/261)
- No intended difference between
R(&f)()and usef()vs. "fbe an expression such thatdecltype((f))isR" and usef. But need to watch out for possible missing "equality-preserving". See issues #531 and #532
implicit expression variations
- Casey: "implicit expression variations" applies to all id-expressions that are const lvalues (after substitution)
- Non-id-expressions not included
- Remember to check while writing if it's sane
- Casey: intended that
ranges::Assignable<T&, const T&>spawn variations for the expression in
requires(T t, U&& u) {
{ t = std::forward<U>(u) } -> ranges::Same<T>&&;
}
, treating the whole std::forward<U>(u) as the "operand" (not just the id-expression u, contrary to previous note)
- Casey: This is needed for
Copyable. - Casey: standalone
ranges::Assignable<T&, const T&>requires all implicit variations on the assignment expression to be non-modifying for the right operand (including when it's a non-const rvalue), butranges::Copyable<T>removes that requirement because it also requiresranges::Movablewhich requiresranges::Assignable<T&, T>, which counts as an explicit requirement that supersedes the implicit requirement.- i.e., the same concept-id can mean different things depending on whether it is used stand-alone or as part of another concept. Explicit/implicit superseding can happen "at a distance" and isn't local to a concept.