Closed tcbrindle closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.30%. Comparing base (
bbdd46f
) to head (4bb55a8
). Report is 11 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The
sequence
concept has several optional customisation points, for exampleread_at_unchecked()
andfor_each_while()
, for which we can provide a reasonable default if the sequence implementation does not.Previously this was handled by the wrapper functions (
flux::read_at_unchecked
etc) examining thesequence_traits<T>
struct and using the customised function if it existed, otherwise falling back to their default implementation.This PR changes the arrangement somewhat. Rather than being strictly optional, the
sequence
concept now requires that all customisation points are implemented. We can still provide default implementations, but this is now handled by havingsequence_traits<T>
inherit from a new base classdefault_sequence_traits
. (In principle using this base class is not required by the sequence concept, but in practise everyone will want to use it.)This has the advantage that user-defined customisations can now be concept-checked; that is, if a user provides an incompatible signature for e.g.
for_each_while
in theirsequence_traits
, it will hide the default implementation, and result in a compile error; previously, the incompatible signature would just have been ignored and the default impl would silently have been used.For complicated sequence implementations (e.g. the
zip
andcartesian_product
families), this means that we also need to be explicit about when we're using the default impls vs using customised versions. This is a good thing.