Closed tcbrindle closed 1 year ago
Patch and project coverage have no change.
Comparison is base (
8ab832c
) 97.70% compared to head (adf3cb5
) 97.70%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Otherwise known as
as_const()
, this behaves like a version ofmap()
which returns a const reference fromread_at()
when the underlying sequence returns a mutable reference.Actually, it does a bit more than that: using the formulation from P2278 (which in turn got it from range-v3) we define a new alias
const_element_t<Seq>
, returningstd::common_reference_t<value_t<Seq> const&&, element_t<Seq>>
. This does The Right Thing in all cases, including things liketuple
s andpair
s of references if the stdlib has the latest C++23 changes.We also define a new concept
read_only_sequence<Seq>
, satisfied when a sequence'selement_t
andconst_element_t
are the same type. This is mostly useful to avoid wrapping anything inread_only()
when the underlying sequence is already const, but might be useful in other circumstances so we'll make it public.