Annex B (normative) Compatibility features [depr]

B.1 General [depr.general]

This Clause describes features of this document that are specified for compatibility with existing implementations.

These are deprecated features, where deprecated is defined as: Normative for the current edition of this document, but having been identified as a candidate for removal from future revisions. An implementation may declare library names and entities described in this section with the deprecated attribute ( ISO/IEC 14882:2014 §[dcl.attr.deprecated]).

B.2 Rvalue range access [depr.rvalue.ranges]

Use of the range access customization point objects begin, end, cbegin, cend, rbegin, rend, crbegin, crend, data, and cdata with rvalue arguments is deprecated. In a future revision of this document, such usage could become ill-formed.

B.3 Range-and-a-half algorithms [depr.algo.range-and-a-half]

The following algorithm signatures are deemed unsafe and are deprecated in this document.

Overloads of algorithms that take a Range argument and a forwarding reference parameter first2_ behave as if they are implemented by calling begin and end on the Range and dispatching to the overload that takes separate iterator and sentinel arguments, perfectly forwarding first2_.

template <InputIterator I1, Sentinel<I1> S1, class I2, class R = equal_to<>,
    class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    IndirectRelation<R, projected<I1, Proj1>, projected<decay_t<I2>, Proj2>>
  tagged_pair<tag::in1(I1), tag::in2(decay_t<I2>)>
    mismatch(I1 first1, S1 last1, I2&& first2_, R comp = R{},
             Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputRange Rng1, class I2, class R = equal_to<>,
    class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    IndirectRelation<R, projected<iterator_t<Rng1>, Proj1>, projected<decay_t<I2>, Proj2>>
  tagged_pair<tag::in1(safe_iterator_t<Rng1>), tag::in2(decay_t<I2>)>
    mismatch(Rng1&& rng1, I2&& first2_, R comp = R{},
             Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

Effects: Equivalent to:

return mismatch(first1, last1, std::forward<I2>(first2_), unreachable{}, comp, proj1, proj2);

except that the underlying algorithm never increments first2 more than last1 - first1 times.

template <InputIterator I1, Sentinel<I1> S1, class I2,
    class R = equal_to<>, class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlyComparable<I1, decay_t<I2>, R, Proj1, Proj2>
  bool equal(I1 first1, S1 last1, I2&& first2_, R comp = R{},
             Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputRange Rng1, class I2, class R = equal_to<>,
    class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlyComparable<iterator_t<Rng1>, decay_t<I2>, R, Proj1, Proj2>
  bool equal(Rng1&& rng1, I2&& first2_, R comp = R{},
             Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

Effects: Equivalent to:

return first1 == mismatch(first1, last1, std::forward<I2>(first2_), comp, proj1, proj2).in1();
template <ForwardIterator I1, Sentinel<I1> S1, class I2,
    class R = equal_to<>, class Proj1 = identity, class Proj2 = identity>
  requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlyComparable<I1, decay_t<I2>, R, Proj1, Proj2>
  bool is_permutation(I1 first1, S1 last1, I2&& first2_, R comp = R{},
                      Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <ForwardRange Rng1, class I2, class R = equal_to<>,
    class Proj1 = identity, class Proj2 = identity>
  requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlyComparable<iterator_t<Rng1>, decay_t<I2>, R, Proj1, Proj2>
  bool is_permutation(Rng1&& rng1, I2&& first2_, R comp = R{},
                      Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

Effects: Equivalent to:

  auto first2 = std::forward<I2>(first2_);
  return is_permutation(first1, last1, first2, next(first2, distance(first1, last1)),
                        comp, proj1, proj2);
template <ForwardIterator I1, Sentinel<I1> S1, class I2>
  requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlySwappable<I1, decay_t<I2>>
  tagged_pair<tag::in1(I1), tag::in2(decay_t<I2>)>
    swap_ranges(I1 first1, S1 last1, I2&& first2_);

template <ForwardRange Rng, class I2>
  requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
    IndirectlySwappable<iterator_t<Rng>, decay_t<I2>>
  tagged_pair<tag::in1(safe_iterator_t<Rng>), tag::in2(decay_t<I2>)>
    swap_ranges(Rng&& rng1, I2&& first2_);

Effects: Equivalent to:

  auto first2 = std::forward<I2>(first2_);
  return swap_ranges(first1, last1, first2, next(first2, distance(first1, last1)));
template <InputIterator I1, Sentinel<I1> S1, class I2, WeaklyIncrementable O,
    CopyConstructible F, class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
        projected<decay_t<I2>, Proj2>)>>
  tagged_tuple<tag::in1(I1), tag::in2(decay_t<I2>), tag::out(O)>
    transform(I1 first1, S1 last1, I2&& first2_, O result,
              F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputRange Rng, class I2, WeaklyIncrementable O, CopyConstructible F,
    class Proj1 = identity, class Proj2 = identity>
  requires InputIterator<decay_t<I2>> && !Range<I2> &&
    Writable<O, indirect_result_of_t<F&(
        projected<iterator_t<Rng>, Proj1>, projected<decay_t<I2>, Proj2>>)>
  tagged_tuple<tag::in1(safe_iterator_t<Rng>), tag::in2(decay_t<I2>), tag::out(O)>
    transform(Rng&& rng1, I2&& first2_, O result,
              F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

Effects: Equivalent to:

return transform(first1, last1, std::forward<I2>(first2_), unreachable{}, pred, proj1, proj2);

except that the underlying algorithm never increments first2 more than last1 - first1 times.