[range.adjacent.transform.view]

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

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

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

#### 25.7.28.2 Class template 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]](range.adjacent.transform.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]](range.adjacent.transform.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](#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)[.](#1.sentence-1)
