24 Ranges library [ranges]

24.7 Range adaptors [range.adaptors]

24.7.9 Drop while view [range.drop.while]

24.7.9.2 Class template drop_Β­while_Β­view [range.drop.while.view]

namespace std::ranges {
  template<view V, class Pred>
    requires input_range<V> && is_object_v<Pred> &&
             indirect_unary_predicate<const Pred, iterator_t<V>>
  class drop_while_view : public view_interface<drop_while_view<V, Pred>> {
  public:
    drop_while_view() = default;
    constexpr drop_while_view(V base, Pred pred);

    constexpr V base() const& requires copy_constructible<V> { return base_; }
    constexpr V base() && { return std::move(base_); }

    constexpr const Pred& pred() const;

    constexpr auto begin();

    constexpr auto end()
    { return ranges::end(base_); }

  private:
    V base_ = V();                                      // exposition only
    semiregular-box<Pred> pred_;                        // exposition only
  };

  template<class R, class Pred>
    drop_while_view(R&&, Pred) -> drop_while_view<views::all_t<R>, Pred>;
}
constexpr drop_while_view(V base, Pred pred);
Effects: Initializes base_Β­ with std​::​move(base) and pred_Β­ with std​::​move(pred).
constexpr const Pred& pred() const;
Effects: Equivalent to: return *pred_Β­;
constexpr auto begin();
Returns: ranges​::​find_Β­if_Β­not(base_Β­, cref(*pred_Β­)).
Remarks: In order to provide the amortized constant-time complexity required by the range concept when drop_Β­while_Β­view models forward_Β­range, the first call caches the result within the drop_Β­while_Β­view for use on subsequent calls.
Note
:
Without this, applying a reverse_Β­view over a drop_Β­while_Β­view would have quadratic iteration complexity.
β€” end note
 ]