The Standard name for this exposition-only concept is _can-reference_.
Differential Revision: https://reviews.llvm.org/D118726
auto __tmp = *this;
++*this;
return __tmp;
- } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __referenceable; } ||
+ } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __can_reference; } ||
!__can_use_postfix_proxy<_Iter>) {
return _VSTD::__unchecked_get<_Iter>(__hold_)++;
} else {
template<class _Ip>
concept input_or_output_iterator =
requires(_Ip __i) {
- { *__i } -> __referenceable;
+ { *__i } -> __can_reference;
} &&
weakly_incrementable<_Ip>;
} // namespace ranges
template<__dereferenceable _Tp>
- requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; }
+ requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
#endif // !_LIBCPP_HAS_NO_CONCEPTS
using __with_reference = _Tp&;
template <class _Tp>
-concept __referenceable = requires {
+concept __can_reference = requires {
typename __with_reference<_Tp>;
};
template <class _Tp>
concept __dereferenceable = requires(_Tp& __t) {
- { *__t } -> __referenceable; // not required to be equality-preserving
+ { *__t } -> __can_reference; // not required to be equality-preserving
};
// [iterator.traits]
template<class _Ip>
concept __cpp17_iterator =
requires(_Ip __i) {
- { *__i } -> __referenceable;
+ { *__i } -> __can_reference;
{ ++__i } -> same_as<_Ip&>;
- { *__i++ } -> __referenceable;
+ { *__i++ } -> __can_reference;
} &&
copyable<_Ip>;
concept __transform_view_constraints =
view<_View> && is_object_v<_Fn> &&
regular_invocable<_Fn&, range_reference_t<_View>> &&
- __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>;
+ __can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>;
template<input_range _View, copy_constructible _Fn>
requires __transform_view_constraints<_View, _Fn>