is_sorted and is_sorted_until algorithms

My bad! Thanks!

On Monday, July 21, 2014, Eric Niebler <notifications@github.com> wrote:

> In include/range/v3/algorithm/is_sorted_until.hpp:
>
> > +                return I{end};
> > +            }
> > +
> > +            template <typename Rng, typename R = ordered_less, typename P = ident,
> > +                      typename I = range_iterator_t<Rng>,
> > +                      typename V = iterator_value_t<I>,
> > +                      CONCEPT_REQUIRES_(
> > +                       ForwardIterable<Rng>() && Invokable<P, V>() &&
> > +                       InvokableRelation<R, concepts::Invokable::result_t<P, V>>())>
> > +            I operator()(Rng &&rng, R rel = R{}, P proj = P{}) const
> > +            {
> > +                return (*this)(begin(rng), end(rng), std::move(rel), std::move(proj));
> > +            }
> > +        };
> > +
> > +        RANGES_CONSTEXPR is_sorted_until_fn is_sorted_until{};
>
> You're confusing two things:
>
>    1. If the algorithm mutates the sequence, it doesn't make sense to
>    accept initializer_lists, and
>    2. If the algorithm returns an iterator, it doesn't make sense to
>    accept rvalue ranges.
>
> is_sorted_until doesn't mutate the sequence, so it should accept
> initializer_lists. It returns an iterator, so it shouldn't accept rvalue
> ranges (that is, the signature is wrong).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ericniebler/range-v3/pull/23/files#r15176122>.
>