[range.drop.overview]

# 25 Ranges library [[ranges]](./#ranges)

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.drop.overview)

### 25.7.12 Drop view [[range.drop]](range.drop#overview)

#### 25.7.12.1 Overview [range.drop.overview]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L6345)

drop_view produces a view
excluding the first N elements from another view, or
an empty range if the adapted view contains fewer than N elements[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L6350)

The name views​::​drop denotes
a range adaptor object ([[range.adaptor.object]](range.adaptor.object "25.7.2 Range adaptor objects"))[.](#2.sentence-1)

Let E and F be expressions,
let T be remove_cvref_t<decltype((E))>, and
let D be range_difference_t<decltype((E))>[.](#2.sentence-2)

If decltype((F)) does not model[convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<D>,views​::​drop(E, F) is ill-formed[.](#2.sentence-3)

Otherwise, the expression views​::​drop(E, F) is expression-equivalent to:

- [(2.1)](#2.1)

  If T is a specialization ofempty_view ([[range.empty.view]](range.empty.view "25.6.2.2 Class template empty_­view")),
then ((void)F, *decay-copy*(E)),
except that the evaluations of E and F are indeterminately sequenced[.](#2.1.sentence-1)

- [(2.2)](#2.2)

  Otherwise, if T models[random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]") and [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]") and is
  * [(2.2.1)](#2.2.1)

a specialization of span ([[views.span]](views.span "23.7.2.2 Class template span")),

  * [(2.2.2)](#2.2.2)

a specialization of basic_string_view ([[string.view]](string.view "27.3 String view classes")),

  * [(2.2.3)](#2.2.3)

a specialization of iota_view ([[range.iota.view]](range.iota.view "25.6.4.2 Class template iota_­view")), or

  * [(2.2.4)](#2.2.4)

a specialization of subrange ([[range.subrange]](range.subrange "25.5.4 Sub-ranges"))
where T​::​*StoreSize* is false,

then U(ranges​::​begin(E) + std​::​min<D>(ranges​::​distance(E), F), ranges​::​end(E)),
except that E is evaluated only once,
where U is span<typename T​::​element_type> if T is a specialization of span and T otherwise[.](#2.2.sentence-1)

- [(2.3)](#2.3)

  Otherwise,
if T is
a specialization of subrange that models [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]") and [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]"),
thenT(ranges​::​begin(E) + std​::​min<D>(ranges​::​distance(E), F), ranges​::​end(E),*to-unsigned-like*(ranges​::​distance(E) - std​::​min<D>(ranges​::​distance(E), F))),
except that E and F are each evaluated only once[.](#2.3.sentence-1)

- [(2.4)](#2.4)

  Otherwise, if T is
a specialization of repeat_view ([[range.repeat.view]](range.repeat.view "25.6.5.2 Class template repeat_­view")):
  * [(2.4.1)](#2.4.1)

if T models [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]"),
thenviews::repeat(*E.*value_*, ranges::distance(E) - std::min<D>(ranges::distance(E), F)) except that E is evaluated only once;

  * [(2.4.2)](#2.4.2)

otherwise, ((void)F, *decay-copy*(E)),
except that the evaluations of E and F are indeterminately sequenced[.](#2.4.sentence-1)

- [(2.5)](#2.5)

  Otherwise, drop_view(E, F)[.](#2.5.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L6417)

[*Example [1](#example-1)*: auto ints = views::iota(0) | views::take(10);for (auto i : ints | views::drop(5)) { cout << i << ' '; // prints 5 6 7 8 9} â *end example*]
