Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/ranges/range.adaptors/range.transform/types.h
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
using CountedIter = stride_counting_iterator<forward_iterator<int*>>; | using CountedIter = stride_counting_iterator<forward_iterator<int*>>; | ||||
struct CountedView : std::ranges::view_base { | struct CountedView : std::ranges::view_base { | ||||
constexpr CountedIter begin() { return CountedIter(ForwardIter(globalBuff)); } | constexpr CountedIter begin() { return CountedIter(ForwardIter(globalBuff)); } | ||||
constexpr CountedIter begin() const { return CountedIter(ForwardIter(globalBuff)); } | constexpr CountedIter begin() const { return CountedIter(ForwardIter(globalBuff)); } | ||||
constexpr CountedIter end() { return CountedIter(ForwardIter(globalBuff + 8)); } | constexpr CountedIter end() { return CountedIter(ForwardIter(globalBuff + 8)); } | ||||
constexpr CountedIter end() const { return CountedIter(ForwardIter(globalBuff + 8)); } | constexpr CountedIter end() const { return CountedIter(ForwardIter(globalBuff + 8)); } | ||||
}; | }; | ||||
using ThreeWayCompIter = three_way_contiguous_iterator<int*>; | |||||
struct ThreeWayCompView : std::ranges::view_base { | |||||
constexpr ThreeWayCompIter begin() { return ThreeWayCompIter(globalBuff); } | |||||
constexpr ThreeWayCompIter begin() const { return ThreeWayCompIter(globalBuff); } | |||||
constexpr ThreeWayCompIter end() { return ThreeWayCompIter(globalBuff + 8); } | |||||
constexpr ThreeWayCompIter end() const { return ThreeWayCompIter(globalBuff + 8); } | |||||
}; | |||||
struct TimesTwo { | struct TimesTwo { | ||||
constexpr int operator()(int x) const { return x * 2; } | constexpr int operator()(int x) const { return x * 2; } | ||||
}; | }; | ||||
struct PlusOneMutable { | struct PlusOneMutable { | ||||
constexpr int operator()(int x) { return x + 1; } | constexpr int operator()(int x) { return x + 1; } | ||||
}; | }; | ||||
Show All 17 Lines |