[range.adjacent.transform]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.adjacent.transform)

### 25.7.28 Adjacent transform view [range.adjacent.transform]

#### [25.7.28.1](#overview) Overview [[range.adjacent.transform.overview]](range.adjacent.transform.overview)

[1](#overview-1)

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

adjacent_transform_view takes an invocable object and
a view and produces a view
whose Mth element is the result of applying the invocable object
to the Mth through (M+Nâ1)th elements
of the original view[.](#overview-1.sentence-1)

If the original view has fewer than N elements, the resulting view is empty[.](#overview-1.sentence-2)

[2](#overview-2)

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

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

Given subexpressions E and F and
a constant expression N:

- [(2.1)](#overview-2.1)

  If N is equal to 0 anddecltype((E)) models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]"),views​::​adjacent_transform<N>(E, F) is expression-equivalent to((void)E, views​::​zip_transform(F)),
except that the evaluations of E and F are
indeterminately sequenced[.](#overview-2.1.sentence-1)

- [(2.2)](#overview-2.2)

  Otherwise,
the expression views​::​adjacent_transform<N>(E, F) is
expression-equivalent toadjacent_transform_view<views​::​all_t<decltype((E))>, decay_t<decltype((F))>, N>(E, F)[.](#overview-2.2.sentence-1)

[3](#overview-3)

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

[*Example [1](#overview-example-1)*: vector v = {1, 2, 3, 4};

for (auto i : v | views::adjacent_transform<2>(std::multiplies())) { cout << i << ' '; // prints 2 6 12} â *end example*]

#### [25.7.28.2](#view) Class template adjacent_transform_view [[range.adjacent.transform.view]](range.adjacent.transform.view)

[ð](#lib:adjacent_transform_view)

namespace std::ranges {template<[forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") V, [move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13 Concept move_­constructible [concept.moveconstructible]") F, size_t N>requires [view](range.view#concept:view "25.4.5 Views [range.view]")<V> && (N > 0) && is_object_v<F> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")<F&, *REPEAT*(range_reference_t<V>, N)...> &&[*can-reference*](iterator.synopsis#concept:can-reference "24.2 Header <iterator>&nbsp;synopsis [iterator.synopsis]")<invoke_result_t<F&, *REPEAT*(range_reference_t<V>, N)...>>class adjacent_transform_view : public view_interface<adjacent_transform_view<V, F, N>> {*movable-box*<F> *fun_*; // *exposition only* adjacent_view<V, N> *inner_*; // *exposition only*using *InnerView* = adjacent_view<V, N>; // *exposition only*template<bool Const>using *inner-iterator* = iterator_t<*maybe-const*<Const, *InnerView*>>; // *exposition only*template<bool Const>using *inner-sentinel* = sentinel_t<*maybe-const*<Const, *InnerView*>>; // *exposition only*// [[range.adjacent.transform.iterator]](#iterator "25.7.28.3 Class template adjacent_­transform_­view​::​iterator"), class template adjacent_transform_view​::​*iterator*template<bool> class *iterator*; // *exposition only*// [[range.adjacent.transform.sentinel]](#sentinel "25.7.28.4 Class template adjacent_­transform_­view​::​sentinel"), class template adjacent_transform_view​::​*sentinel*template<bool> class *sentinel*; // *exposition only*public: adjacent_transform_view() = default; constexpr explicit adjacent_transform_view(V base, F fun); constexpr V base() const & requires [copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]")<V> { return *inner_*.base(); }constexpr V base() && { return std::move(*inner_*).base(); }constexpr auto begin() {return *iterator*<false>(*this, *inner_*.begin()); }constexpr auto begin() constrequires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const *InnerView*> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")<const F&, *REPEAT*(range_reference_t<const V>, N)...> {return *iterator*<true>(*this, *inner_*.begin()); }constexpr auto end() {if constexpr ([common_range](range.refinements#concept:common_range "25.4.6 Other range refinements [range.refinements]")<*InnerView*>) {return *iterator*<false>(*this, *inner_*.end()); } else {return *sentinel*<false>(*inner_*.end()); }}constexpr auto end() constrequires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const *InnerView*> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")<const F&, *REPEAT*(range_reference_t<const V>, N)...> {if constexpr ([common_range](range.refinements#concept:common_range "25.4.6 Other range refinements [range.refinements]")<const *InnerView*>) {return *iterator*<true>(*this, *inner_*.end()); } else {return *sentinel*<true>(*inner_*.end()); }}constexpr auto size() requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<*InnerView*> {return *inner_*.size(); }constexpr auto size() const requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const *InnerView*> {return *inner_*.size(); }constexpr auto reserve_hint() requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<*InnerView*> {return *inner_*.reserve_hint(); }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 *InnerView*> {return *inner_*.reserve_hint(); }};}

[ð](#lib:adjacent_transform_view,constructor)

`constexpr explicit adjacent_transform_view(V base, F fun);
`

[1](#view-1)

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

*Effects*: Initializes *fun_* with std​::​move(fun) and*inner_* with std​::​move(base)[.](#view-1.sentence-1)

#### [25.7.28.3](#iterator) Class template adjacent_transform_view​::​*iterator* [[range.adjacent.transform.iterator]](range.adjacent.transform.iterator)

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

namespace std::ranges {template<[forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") V, [move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13 Concept move_­constructible [concept.moveconstructible]") F, size_t N>requires [view](range.view#concept:view "25.4.5 Views [range.view]")<V> && (N > 0) && is_object_v<F> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")<F&, *REPEAT*(range_reference_t<V>, N)...> &&[*can-reference*](iterator.synopsis#concept:can-reference "24.2 Header <iterator>&nbsp;synopsis [iterator.synopsis]")<invoke_result_t<F&, *REPEAT*(range_reference_t<V>, N)...>>template<bool Const>class adjacent_transform_view<V, F, N>::*iterator* {using *Parent* = *maybe-const*<Const, adjacent_transform_view>; // *exposition only*using *Base* = *maybe-const*<Const, V>; // *exposition only**Parent** *parent_* = nullptr; // *exposition only**inner-iterator*<Const> *inner_*; // *exposition only*constexpr *iterator*(*Parent*& parent, *inner-iterator*<Const> inner); // *exposition only*public:using iterator_category = *see below*; using iterator_concept = typename *inner-iterator*<Const>::iterator_concept; using value_type = remove_cvref_t<invoke_result_t<*maybe-const*<Const, F>&, *REPEAT*(range_reference_t<*Base*>, N)...>>; using difference_type = range_difference_t<*Base*>; *iterator*() = default; constexpr *iterator*(*iterator*<!Const> i)requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<*inner-iterator*<false>, *inner-iterator*<Const>>; constexpr decltype(auto) operator*() const noexcept(*see below*); constexpr *iterator*& operator++(); constexpr *iterator* operator++(int); 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 decltype(auto) operator[](difference_type n) constrequires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr bool operator==(const *iterator*& x, const *iterator*& y); friend constexpr bool operator<(const *iterator*& 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 bool operator>(const *iterator*& 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 bool operator<=(const *iterator*& 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 bool operator>=(const *iterator*& 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 auto operator<=>(const *iterator*& x, const *iterator*& y)requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<*Base*> && [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]")<*inner-iterator*<Const>>; friend constexpr *iterator* operator+(const *iterator*& i, difference_type n)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 n, const *iterator*& i)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*& i, difference_type n)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)requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<*inner-iterator*<Const>, *inner-iterator*<Const>>; };}

[1](#iterator-1)

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

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

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

  If invoke_result_t<*maybe-const*<Const, F>&,*REPEAT*(range_reference_t<*Base*>, N)...> is not a reference,iterator_category denotes input_iterator_tag[.](#iterator-1.1.sentence-1)

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

  Otherwise, let C denote the typeiterator_traits<iterator_t<*Base*>>​::​iterator_category[.](#iterator-1.2.sentence-1)

  * [(1.2.1)](#iterator-1.2.1)

      If [derived_from](concept.derived#concept:derived_from "18.4.3 Concept derived_­from [concept.derived]")<C, random_access_iterator_tag> is true,iterator_category denotes random_access_iterator_tag[.](#iterator-1.2.1.sentence-1)

  * [(1.2.2)](#iterator-1.2.2)

      Otherwise,
if [derived_from](concept.derived#concept:derived_from "18.4.3 Concept derived_­from [concept.derived]")<C, bidirectional_iterator_tag> is true,iterator_category denotes bidirectional_iterator_tag[.](#iterator-1.2.2.sentence-1)

  * [(1.2.3)](#iterator-1.2.3)

      Otherwise,
if [derived_from](concept.derived#concept:derived_from "18.4.3 Concept derived_­from [concept.derived]")<C, forward_iterator_tag> is true,iterator_category denotes forward_iterator_tag[.](#iterator-1.2.3.sentence-1)

  * [(1.2.4)](#iterator-1.2.4)

      Otherwise, iterator_category denotes input_iterator_tag[.](#iterator-1.2.4.sentence-1)

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

`constexpr iterator(Parent& parent, inner-iterator<Const> inner);
`

[2](#iterator-2)

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

*Effects*: Initializes *parent_* with addressof(parent) and*inner_* with std​::​move(inner)[.](#iterator-2.sentence-1)

[ð](#lib:adjacent_transform_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]")<inner-iterator<false>, inner-iterator<Const>>;
`

[3](#iterator-3)

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

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

[ð](#lib:operator*,adjacent_transform_view::iterator)

`constexpr decltype(auto) operator*() const noexcept(see below);
`

[4](#iterator-4)

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

*Effects*: Equivalent to:return apply([&](const auto&... iters) -> decltype(auto) {return invoke(**parent_*->*fun_*, *iters...);}, *inner_*.*current_*);

[5](#iterator-5)

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

*Remarks*: Let Is be the pack 0, 1, …, (N - 1)[.](#iterator-5.sentence-1)

The exception specification is equivalent to:noexcept(invoke(**parent_*->*fun_*, *std::get<Is>(*inner_*.*current_*)...))

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

`constexpr iterator& operator++();
`

[6](#iterator-6)

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

*Effects*: Equivalent to:++*inner_*;return *this;

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

`constexpr iterator operator++(int);
`

[7](#iterator-7)

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

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

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

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

[8](#iterator-8)

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

*Effects*: Equivalent to:--*inner_*;return *this;

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

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

[9](#iterator-9)

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

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

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

`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>;
`

[10](#iterator-10)

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

*Effects*: Equivalent to:*inner_* += x;return *this;

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

`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>;
`

[11](#iterator-11)

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

*Effects*: Equivalent to:*inner_* -= x;return *this;

[ð](#lib:operator%5b%5d,adjacent_transform_view::iterator)

`constexpr decltype(auto) operator[](difference_type n) const
  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#L13607)

*Effects*: Equivalent to:return apply([&](const auto&... iters) -> decltype(auto) {return invoke(**parent_*->*fun_*, iters[n]...);}, *inner_*.*current_*);

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

`friend constexpr bool operator==(const iterator& x, const iterator& y);
friend constexpr bool operator<(const iterator& 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 bool operator>(const iterator& 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 bool operator<=(const iterator& 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 bool operator>=(const iterator& 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 auto operator<=>(const iterator& x, const iterator& y)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base> && [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]")<inner-iterator<Const>>;
`

[13](#iterator-13)

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

Let *op* be the operator[.](#iterator-13.sentence-1)

[14](#iterator-14)

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

*Effects*: Equivalent to: return x.*inner_* *op* y.*inner_*;

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

`friend constexpr iterator operator+(const iterator& i, difference_type n)
  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 n, const iterator& i)
  requires [random_access_range](range.refinements#concept:random_access_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[15](#iterator-15)

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

*Effects*: Equivalent to: return *iterator*(*i.*parent_*, i.*inner_* + n);

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

`friend constexpr iterator operator-(const iterator& i, difference_type n)
  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#L13662)

*Effects*: Equivalent to: return *iterator*(*i.*parent_*, i.*inner_* - n);

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

`friend constexpr difference_type operator-(const iterator& x, const iterator& y)
  requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<inner-iterator<Const>, inner-iterator<Const>>;
`

[17](#iterator-17)

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

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

#### [25.7.28.4](#sentinel) Class template adjacent_transform_view​::​*sentinel* [[range.adjacent.transform.sentinel]](range.adjacent.transform.sentinel)

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

namespace std::ranges {template<[forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") V, [move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13 Concept move_­constructible [concept.moveconstructible]") F, size_t N>requires [view](range.view#concept:view "25.4.5 Views [range.view]")<V> && (N > 0) && is_object_v<F> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")<F&, *REPEAT*(range_reference_t<V>, N)...> &&[*can-reference*](iterator.synopsis#concept:can-reference "24.2 Header <iterator>&nbsp;synopsis [iterator.synopsis]")<invoke_result_t<F&, *REPEAT*(range_reference_t<V>, N)...>>template<bool Const>class adjacent_transform_view<V, F, N>::*sentinel* {*inner-sentinel*<Const> *inner_*; // *exposition only*constexpr explicit *sentinel*(*inner-sentinel*<Const> inner); // *exposition only*public:*sentinel*() = default; constexpr *sentinel*(*sentinel*<!Const> i)requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<*inner-sentinel*<false>, *inner-sentinel*<Const>>; template<bool OtherConst>requires [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<*inner-sentinel*<Const>, *inner-iterator*<OtherConst>>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]")<*inner-sentinel*<Const>, *inner-iterator*<OtherConst>>friend constexpr range_difference_t<*maybe-const*<OtherConst, *InnerView*>>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]")<*inner-sentinel*<Const>, *inner-iterator*<OtherConst>>friend constexpr range_difference_t<*maybe-const*<OtherConst, *InnerView*>>operator-(const *sentinel*& x, const *iterator*<OtherConst>& y); };}

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

`constexpr explicit sentinel(inner-sentinel<Const> inner);
`

[1](#sentinel-1)

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

*Effects*: Initializes *inner_* with inner[.](#sentinel-1.sentence-1)

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

`constexpr sentinel(sentinel<!Const> i)
  requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<inner-sentinel<false>, inner-sentinel<Const>>;
`

[2](#sentinel-2)

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

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

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

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

[3](#sentinel-3)

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

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

[ð](#lib:operator-,adjacent_transform_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]")<inner-sentinel<Const>, inner-iterator<OtherConst>>
friend constexpr range_difference_t<maybe-const<OtherConst, InnerView>>
  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]")<inner-sentinel<Const>, inner-iterator<OtherConst>>
friend constexpr range_difference_t<maybe-const<OtherConst, InnerView>>
  operator-(const sentinel& x, const iterator<OtherConst>& y);
`

[4](#sentinel-4)

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

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