A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue4241 below:

for_each(_n) should be less constrained

template<input_iterator I, sentinel_for<I> S, class Proj = identity,
         indirectly_unary_invocable<projected<I, Proj>>move_constructible Fun>
  requires invocable<Fun&, iter_reference_t<projected<I, Proj>>>
  constexpr ranges::for_each_result<I, Fun>
    ranges::for_each(I first, S last, Fun f, Proj proj = {});
template<input_range R, class Proj = identity,
         indirectly_unary_invocable<projected<iterator_t<R>, Proj>>move_constructible Fun>
  requires invocable<Fun&, iter_reference_t<projected<iterator_t<R>, Proj>>>
  constexpr ranges::for_each_result<borrowed_iterator_t<R>, Fun>
    ranges::for_each(R&& r, Fun f, Proj proj = {});

[…]

-15- [Note 6: The overloads in namespace ranges require Fun to model copy_constructible. — end note]

[…]

template<input_iterator I, class Proj = identity,
         indirectly_unary_invocable<projected<I, Proj>>move_constructible Fun>
  requires invocable<Fun&, iter_reference_t<projected<I, Proj>>>
  constexpr ranges::for_each_n_result<I, Fun>
    ranges::for_each_n(I first, iter_difference_t<I> n, Fun f, Proj proj = {});

[…]

-30- [Note 11: The overload in namespace ranges requires Fun to model copy_constructible. — end note]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4