[range.enumerate]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.enumerate)

### 25.7.24 Enumerate view [range.enumerate]

#### [25.7.24.1](#overview) Overview [[range.enumerate.overview]](range.enumerate.overview)

[1](#overview-1)

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

enumerate_view is a view whose
elements represent both the position and value from
a sequence of elements[.](#overview-1.sentence-1)

[2](#overview-2)

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

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

Given a subexpression E,
the expression views​::​enumerate(E) is expression-equivalent toenumerate_view<views​::​all_t<decltype((E))>>(E)[.](#overview-2.sentence-2)

[*Example [1](#overview-example-1)*: vector<int> vec{ 1, 2, 3 };for (auto [index, value] : views::enumerate(vec)) cout << index << ":" << value << ' '; // prints 0:1 1:2 2:3 â *end example*]

#### [25.7.24.2](#view) Class template enumerate_view [[range.enumerate.view]](range.enumerate.view)

[ð](#lib:enumerate_view_)

namespace std::ranges {template<[view](range.view#concept:view "25.4.5 Views [range.view]") V>requires [*range-with-movable-references*](range.utility.helpers#concept:range-with-movable-references "25.5.2 Helper concepts [range.utility.helpers]")<V>class enumerate_view : public view_interface<enumerate_view<V>> { V *base_* = V(); // *exposition only*// [[range.enumerate.iterator]](#iterator "25.7.24.3 Class template enumerate_­view​::​iterator"), class template enumerate_view​::​*iterator*template<bool Const>class *iterator*; // *exposition only*// [[range.enumerate.sentinel]](#sentinel "25.7.24.4 Class template enumerate_­view​::​sentinel"), class template enumerate_view​::​*sentinel*template<bool Const>class *sentinel*; // *exposition only*public:constexpr enumerate_view() requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")<V> = default; constexpr explicit enumerate_view(V base); constexpr auto begin() requires (![*simple-view*](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>){ return *iterator*<false>(ranges::begin(*base_*), 0); }constexpr auto begin() const requires [*range-with-movable-references*](range.utility.helpers#concept:range-with-movable-references "25.5.2 Helper concepts [range.utility.helpers]")<const V>{ return *iterator*<true>(ranges::begin(*base_*), 0); }constexpr auto end() requires (![*simple-view*](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>) {if constexpr ([forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<V> && [common_range](range.refinements#concept:common_range "25.4.6 Other range refinements [range.refinements]")<V> && [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<V>)return *iterator*<false>(ranges::end(*base_*), ranges::distance(*base_*)); elsereturn *sentinel*<false>(ranges::end(*base_*)); }constexpr auto end() const requires [*range-with-movable-references*](range.utility.helpers#concept:range-with-movable-references "25.5.2 Helper concepts [range.utility.helpers]")<const V> {if constexpr ([forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<const V> && [common_range](range.refinements#concept:common_range "25.4.6 Other range refinements [range.refinements]")<const V> && [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const V>)return *iterator*<true>(ranges::end(*base_*), ranges::distance(*base_*)); elsereturn *sentinel*<true>(ranges::end(*base_*)); }constexpr auto size() requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<V>{ return ranges::size(*base_*); }constexpr auto size() const requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const V>{ return ranges::size(*base_*); }constexpr auto reserve_hint() requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<V>{ return ranges::reserve_hint(*base_*); }constexpr auto reserve_hint() const requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<const V>{ return ranges::reserve_hint(*base_*); }constexpr V base() const & requires [copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]")<V> { return *base_*; }constexpr V base() && { return std::move(*base_*); }}; template<class R> enumerate_view(R&&) -> enumerate_view<views::all_t<R>>;}

[ð](#lib:enumerate_view,constructor)

`constexpr explicit enumerate_view(V base);
`

[1](#view-1)

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

*Effects*: Initializes *base_* with std​::​move(base)[.](#view-1.sentence-1)

#### [25.7.24.3](#iterator) Class template enumerate_view​::​*iterator* [[range.enumerate.iterator]](range.enumerate.iterator)

[ð](#lib:enumerate_view::iterator)

namespace std::ranges {template<[view](range.view#concept:view "25.4.5 Views [range.view]") V>requires [*range-with-movable-references*](range.utility.helpers#concept:range-with-movable-references "25.5.2 Helper concepts [range.utility.helpers]")<V>template<bool Const>class enumerate_view<V>::*iterator* {using *Base* = *maybe-const*<Const, V>; // *exposition only*public:using iterator_category = input_iterator_tag; using iterator_concept = *see below*; using difference_type = range_difference_t<*Base*>; using value_type = tuple<difference_type, range_value_t<*Base*>>; private:using *reference-type* = // *exposition only* tuple<difference_type, range_reference_t<*Base*>>;
 iterator_t<*Base*> *current_* = iterator_t<*Base*>(); // *exposition only* difference_type *pos_* = 0; // *exposition only*constexpr explicit*iterator*(iterator_t<*Base*> current, difference_type pos); // *exposition only*public:*iterator*() requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")<iterator_t<*Base*>> = default; constexpr *iterator*(*iterator*<!Const> i)requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<iterator_t<V>, iterator_t<*Base*>>; constexpr const iterator_t<*Base*>& base() const & noexcept; constexpr iterator_t<*Base*> base() &&; constexpr difference_type index() const noexcept; constexpr auto operator*() const {return *reference-type*(*pos_*, **current_*); }constexpr *iterator*& operator++(); constexpr void operator++(int); constexpr *iterator* operator++(int) requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr *iterator*& operator--() requires [bidirectional_range](range.refinements#concept:bidirectional_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr *iterator* operator--(int) requires [bidirectional_range](range.refinements#concept:bidirectional_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr *iterator*& operator+=(difference_type x)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr *iterator*& operator-=(difference_type x)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr auto operator[](difference_type n) constrequires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>{ return *reference-type*(*pos_* + n, *current_*[n]); }friend constexpr bool operator==(const *iterator*& x, const *iterator*& y) noexcept; friend constexpr strong_ordering operator<=>(const *iterator*& x, const *iterator*& y) noexcept; friend constexpr *iterator* operator+(const *iterator*& x, difference_type y)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr *iterator* operator+(difference_type x, const *iterator*& y)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr *iterator* operator-(const *iterator*& x, difference_type y)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr difference_type operator-(const *iterator*& x, const *iterator*& y) noexcept; friend constexpr auto iter_move(const *iterator*& i)noexcept(noexcept(ranges::iter_move(i.*current_*)) && is_nothrow_move_constructible_v<range_rvalue_reference_t<*Base*>>) {return tuple<difference_type,
 range_rvalue_reference_t<*Base*>>(i.*pos_*, ranges::iter_move(i.*current_*)); }};}

[1](#iterator-1)

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

The member [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]")*iterator*​::​iterator_concept is defined as follows:

- [(1.1)](#iterator-1.1)

  If *Base* models [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]"),
then iterator_concept denotes random_access_iterator_tag[.](#iterator-1.1.sentence-1)

- [(1.2)](#iterator-1.2)

  Otherwise, if *Base* models [bidirectional_range](range.refinements#concept:bidirectional_range "25.4.6 Other range refinements [range.refinements]"),
then iterator_concept denotes bidirectional_iterator_tag[.](#iterator-1.2.sentence-1)

- [(1.3)](#iterator-1.3)

  Otherwise, if *Base* models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]"),
then iterator_concept denotes forward_iterator_tag[.](#iterator-1.3.sentence-1)

- [(1.4)](#iterator-1.4)

  Otherwise, iterator_concept denotes input_iterator_tag[.](#iterator-1.4.sentence-1)

[ð](#lib:enumerate_view::iterator,constructor)

`constexpr explicit iterator(iterator_t<Base> current, difference_type pos);
`

[2](#iterator-2)

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

*Effects*: Initializes *current_* with std​::​move(current) and*pos_* with pos[.](#iterator-2.sentence-1)

[ð](#lib:enumerate_view::iterator,constructor_)

`constexpr iterator(iterator<!Const> i)
  requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<iterator_t<V>, iterator_t<Base>>;
`

[3](#iterator-3)

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

*Effects*: Initializes *current_* with std​::​move(i.*current_*) and*pos_* with i.*pos_*[.](#iterator-3.sentence-1)

[ð](#lib:base,enumerate_view::iterator)

`constexpr const iterator_t<Base>& base() const & noexcept;
`

[4](#iterator-4)

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

*Effects*: Equivalent to: return *current_*;

[ð](#lib:base,enumerate_view::iterator_)

`constexpr iterator_t<Base> base() &&;
`

[5](#iterator-5)

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

*Effects*: Equivalent to: return std​::​move(*current_*);

[ð](#lib:index,enumerate_view::iterator)

`constexpr difference_type index() const noexcept;
`

[6](#iterator-6)

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

*Effects*: Equivalent to: return *pos_*;

[ð](#lib:operator++,enumerate_view::iterator)

`constexpr iterator& operator++();
`

[7](#iterator-7)

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

*Effects*: Equivalent to:++*current_*;++*pos_*;return *this;

[ð](#lib:operator++,enumerate_view::iterator_)

`constexpr void operator++(int);
`

[8](#iterator-8)

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

*Effects*: Equivalent to ++*this[.](#iterator-8.sentence-1)

[ð](#lib:operator++,enumerate_view::iterator__)

`constexpr iterator operator++(int) requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[9](#iterator-9)

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

*Effects*: Equivalent to:auto temp = *this;++*this;return temp;

[ð](#lib:operator--,enumerate_view::iterator)

`constexpr iterator& operator--() requires [bidirectional_range](range.refinements#concept:bidirectional_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[10](#iterator-10)

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

*Effects*: Equivalent to:--*current_*;--*pos_*;return *this;

[ð](#lib:operator--,enumerate_view::iterator_)

`constexpr iterator operator--(int) requires [bidirectional_range](range.refinements#concept:bidirectional_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[11](#iterator-11)

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

*Effects*: Equivalent to:auto temp = *this;--*this;return temp;

[ð](#lib:operator+=,enumerate_view::iterator)

`constexpr iterator& operator+=(difference_type n)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[12](#iterator-12)

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

*Effects*: Equivalent to:*current_* += n;*pos_* += n;return *this;

[ð](#lib:operator-=,enumerate_view::iterator)

`constexpr iterator& operator-=(difference_type n)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[13](#iterator-13)

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

*Effects*: Equivalent to:*current_* -= n;*pos_* -= n;return *this;

[ð](#lib:operator==,enumerate_view::iterator)

`friend constexpr bool operator==(const iterator& x, const iterator& y) noexcept;
`

[14](#iterator-14)

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

*Effects*: Equivalent to: return x.*pos_* == y.*pos_*;

[ð](#lib:operator%3c=%3e,enumerate_view::iterator)

`friend constexpr strong_ordering operator<=>(const iterator& x, const iterator& y) noexcept;
`

[15](#iterator-15)

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

*Effects*: Equivalent to: return x.*pos_* <=> y.*pos_*;

[ð](#lib:operator+,enumerate_view::iterator)

`friend constexpr iterator operator+(const iterator& x, difference_type y)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[16](#iterator-16)

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

*Effects*: Equivalent to:auto temp = x;
temp += y;return temp;

[ð](#lib:operator+,enumerate_view::iterator_)

`friend constexpr iterator operator+(difference_type x, const iterator& y)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[17](#iterator-17)

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

*Effects*: Equivalent to: return y + x;

[ð](#lib:operator-,enumerate_view::iterator)

`friend constexpr iterator operator-(const iterator& x, difference_type y)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[18](#iterator-18)

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

*Effects*: Equivalent to:auto temp = x;
temp -= y;return temp;

[ð](#lib:operator-,enumerate_view::iterator_)

`friend constexpr difference_type operator-(const iterator& x, const iterator& y) noexcept;
`

[19](#iterator-19)

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

*Effects*: Equivalent to: return x.*pos_* - y.*pos_*;

#### [25.7.24.4](#sentinel) Class template enumerate_view​::​*sentinel* [[range.enumerate.sentinel]](range.enumerate.sentinel)

[ð](#lib:enumerate_view::sentinel)

namespace std::ranges {template<[view](range.view#concept:view "25.4.5 Views [range.view]") V>requires [*range-with-movable-references*](range.utility.helpers#concept:range-with-movable-references "25.5.2 Helper concepts [range.utility.helpers]")<V>template<bool Const>class enumerate_view<V>::*sentinel* {using *Base* = *maybe-const*<Const, V>; // *exposition only* sentinel_t<*Base*> *end_* = sentinel_t<*Base*>(); // *exposition only*constexpr explicit *sentinel*(sentinel_t<*Base*> end); // *exposition only*public:*sentinel*() = default; constexpr *sentinel*(*sentinel*<!Const> other)requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<sentinel_t<V>, sentinel_t<*Base*>>; constexpr sentinel_t<*Base*> base() const; template<bool OtherConst>requires [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<sentinel_t<*Base*>, iterator_t<*maybe-const*<OtherConst, V>>>friend constexpr bool operator==(const *iterator*<OtherConst>& x, const *sentinel*& y); template<bool OtherConst>requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<*Base*>, iterator_t<*maybe-const*<OtherConst, V>>>friend constexpr range_difference_t<*maybe-const*<OtherConst, V>>operator-(const *iterator*<OtherConst>& x, const *sentinel*& y); template<bool OtherConst>requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<*Base*>, iterator_t<*maybe-const*<OtherConst, V>>>friend constexpr range_difference_t<*maybe-const*<OtherConst, V>>operator-(const *sentinel*& x, const *iterator*<OtherConst>& y); };}

[ð](#lib:enumerate_view::sentinel,constructor)

`constexpr explicit sentinel(sentinel_t<Base> end);
`

[1](#sentinel-1)

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

*Effects*: Initializes *end_* with std​::​move(end)[.](#sentinel-1.sentence-1)

[ð](#lib:enumerate_view::sentinel,constructor_)

`constexpr sentinel(sentinel<!Const> other)
  requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<sentinel_t<V>, sentinel_t<Base>>;
`

[2](#sentinel-2)

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

*Effects*: Initializes *end_* with std​::​move(other.*end_*)[.](#sentinel-2.sentence-1)

[ð](#lib:base,enumerate_view::sentinel)

`constexpr sentinel_t<Base> base() const;
`

[3](#sentinel-3)

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

*Effects*: Equivalent to: return *end_*;

[ð](#lib:operator==,enumerate_view::sentinel)

`template<bool OtherConst>
  requires [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
`

[4](#sentinel-4)

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

*Effects*: Equivalent to: return x.*current_* == y.*end_*;

[ð](#lib:operator-,enumerate_view::sentinel)

`template<bool OtherConst>
  requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
friend constexpr range_difference_t<maybe-const<OtherConst, V>>
  operator-(const iterator<OtherConst>& x, const sentinel& y);
`

[5](#sentinel-5)

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

*Effects*: Equivalent to: return x.*current_* - y.*end_*;

[ð](#lib:operator-,enumerate_view::sentinel_)

`template<bool OtherConst>
  requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
friend constexpr range_difference_t<maybe-const<OtherConst, V>>
  operator-(const sentinel& x, const iterator<OtherConst>& y);
`

[6](#sentinel-6)

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

*Effects*: Equivalent to: return x.*end_* - y.*current_*;
