我发现这typename gsl::span<const gsl::byte>::const_iterator
不满足Readable
range-v3 中的概念。在浏览了这个概念之后,我发现了这个约束:
template<typename I>
auto requires_(I&&) -> decltype(
concepts::valid_expr(
// The value, reference and rvalue reference types are related
// through the CommonReference concept.
concepts::model_of<CommonReference, reference_t<I> &&, value_t<I> &>(),
concepts::model_of<CommonReference, reference_t<I> &&, rvalue_reference_t<I> &&>(),
concepts::model_of<CommonReference, rvalue_reference_t<I> &&, value_t<I> const &>(),
// Experimental additional tests. If nothing else, this is a good workout
// for the common_reference code.
concepts::model_of<Same, ranges::common_reference_t<reference_t<I>, value_t<I>>, value_t<I>>(),
concepts::model_of<Same, ranges::common_reference_t<rvalue_reference_t<I>, value_t<I>>, value_t<I>>()
));
ranges::common_reference_t
const
从 the中删除value_type
,然后它们就不一样了。
CommonReference
约束是什么意思?为什么要Readable
满足他们?