Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8e34763
[libc++][ranges] P3059R2: Making user-defined constructors of view it…
H-G-Hristov Apr 3, 2026
e9a32ca
Tests: `split_view`
H-G-Hristov Apr 5, 2026
cf1dc7a
Tests: `take_view`
H-G-Hristov Apr 5, 2026
fd1f6ee
Tests: `take_while_view`
H-G-Hristov Apr 9, 2026
666c86a
Tests: `filter_view`
H-G-Hristov Apr 9, 2026
cd91923
Tests: `lazy_split_view`
H-G-Hristov Apr 9, 2026
4581bdc
Tests: `join_view`
H-G-Hristov Apr 9, 2026
f6daa20
Tests: `istream_view`
H-G-Hristov Apr 9, 2026
4186467
Tests: `iota_view`
H-G-Hristov Apr 9, 2026
9ea8e2c
Tests: `elements_view`
H-G-Hristov Apr 11, 2026
c54da86
Format
H-G-Hristov Apr 24, 2026
428278a
Release notes
H-G-Hristov Jul 17, 2026
f80bcca
Format
H-G-Hristov Jul 17, 2026
6da2fb0
Tests: `elements_view` updates
H-G-Hristov Jul 20, 2026
2522cc1
Revert formatting
H-G-Hristov Jul 20, 2026
94e99c0
Apply suggestion from @frederick-vs-ja
Zingam Jul 20, 2026
b0958e7
Fixed formatting
H-G-Hristov Jul 20, 2026
656265d
Enable test
H-G-Hristov Jul 20, 2026
792757c
Added `std::is_constructible/convertible` tests
H-G-Hristov Jul 21, 2026
21cafc7
Cleanup
H-G-Hristov Jul 22, 2026
fb026c3
Fixed CI
H-G-Hristov Jul 22, 2026
40e4eb9
Restored a test case!
H-G-Hristov Jul 22, 2026
09acb0d
Added a missing `take_view` test
H-G-Hristov Jul 22, 2026
ba73c41
Added missing test `join_view`
H-G-Hristov Jul 22, 2026
2f4a7d4
Update tests `split_view`
H-G-Hristov Jul 22, 2026
4b7ed09
Fixed test
H-G-Hristov Jul 22, 2026
2e22271
Added missing `transform_view` tests
H-G-Hristov Jul 22, 2026
67392d1
Try to fix the tests
H-G-Hristov Jul 22, 2026
e692e9b
Formatting
H-G-Hristov Jul 22, 2026
ddb5c85
More fixes
H-G-Hristov Jul 22, 2026
2e1494c
More fixes
H-G-Hristov Jul 22, 2026
71723ab
Clean-up tests
H-G-Hristov Jul 23, 2026
f5c82b2
Clean-up `elements_view`
H-G-Hristov Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libcxx/docs/ReleaseNotes/24.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Implemented Papers
------------------

- P0493R5: Atomic minimum/maximum (`Github <https://llvm.org/PR105418>`__)
- P3059R2: Making user-defined constructors of view iterators/sentinels private (`Github <https://github.com/llvm/llvm-project/issues/189599>`__)
Comment thread
Zingam marked this conversation as resolved.
- P0792R14: ``function_ref`` : a type-erased callable reference (`Github <https://llvm.org/PR105376>`__)
- P3948R1: ``constant_wrapper`` is the only tool needed for passing constant expressions via function arguments (`Github <https://llvm.org/PR189604>`__)
- P3961R1: Less double indirection in ``function_ref`` (RU-220) (`Github <https://llvm.org/PR189606>`__)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx26Papers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"`P4140R0 <https://wg21.link/P4140R0>`__","Proposed resolution for US70-126: allow incomplete types in type_order","2026-03 (Croydon)","","","`#189595 <https://github.com/llvm/llvm-project/issues/189595>`__",""
"`P3373R4 <https://wg21.link/P3373R4>`__","Of Operation States and Their Lifetimes","2026-03 (Croydon)","","","`#189597 <https://github.com/llvm/llvm-project/issues/189597>`__",""
"`P3986R1 <https://wg21.link/P3986R1>`__","A Wording Strategy for Inlinable Receivers","2026-03 (Croydon)","","","`#189598 <https://github.com/llvm/llvm-project/issues/189598>`__",""
"`P3059R2 <https://wg21.link/P3059R2>`__","Making user-defined constructors of view iterators/sentinels private","2026-03 (Croydon)","","","`#189599 <https://github.com/llvm/llvm-project/issues/189599>`__",""
"`P3059R2 <https://wg21.link/P3059R2>`__","Making user-defined constructors of view iterators/sentinels private","2026-03 (Croydon)","|Complete|","24","`#189599 <https://github.com/llvm/llvm-project/issues/189599>`__",""
"`P3725R3 <https://wg21.link/P3725R3>`__","Filter View Extensions for Safer Use, Rev 3","2026-03 (Croydon)","","","`#189601 <https://github.com/llvm/llvm-project/issues/189601>`__",""
"`P3828R1 <https://wg21.link/P3828R1>`__","Rename the to_input view to as_input","2026-03 (Croydon)","","","`#189602 <https://github.com/llvm/llvm-project/issues/189602>`__",""
"`P3795R2 <https://wg21.link/P3795R2>`__","Miscellaneous Reflection Cleanup","2026-03 (Croydon)","","","`#189603 <https://github.com/llvm/llvm-project/issues/189603>`__",""
Expand Down
12 changes: 8 additions & 4 deletions libcxx/include/__ranges/elements_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ template <input_range _View, size_t _Np>
template <bool _Const>
class elements_view<_View, _Np>::__iterator
: public __elements_view_iterator_category_base<__maybe_const<_Const, _View>, _Np> {
friend class elements_view<_View, _Np>;

template <bool>
friend class __iterator;

Expand All @@ -175,6 +177,8 @@ class elements_view<_View, _Np>::__iterator

iterator_t<_Base> __current_ = iterator_t<_Base>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(iterator_t<_Base> __current) : __current_(std::move(__current)) {}

_LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto) __get_element(const iterator_t<_Base>& __i) {
if constexpr (is_reference_v<range_reference_t<_Base>>) {
return std::get<_Np>(*__i);
Expand Down Expand Up @@ -205,8 +209,6 @@ class elements_view<_View, _Np>::__iterator
requires default_initializable<iterator_t<_Base>>
= default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(iterator_t<_Base> __current) : __current_(std::move(__current)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
: __current_(std::move(__i.__current_)) {}
Expand Down Expand Up @@ -339,6 +341,10 @@ class elements_view<_View, _Np>::__sentinel {
using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
_LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}

friend class elements_view<_View, _Np>;

template <bool>
friend class __sentinel;

Expand All @@ -350,8 +356,6 @@ class elements_view<_View, _Np>::__sentinel {
public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __other)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__other.__end_)) {}
Expand Down
20 changes: 13 additions & 7 deletions libcxx/include/__ranges/filter_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,16 @@ struct __filter_iterator_category<_View> {
template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
class filter_view<_View, _Pred>::__iterator : public __filter_iterator_category<_View> {
public:
private:
_LIBCPP_NO_UNIQUE_ADDRESS iterator_t<_View> __current_ = iterator_t<_View>();
_LIBCPP_NO_UNIQUE_ADDRESS filter_view* __parent_ = nullptr;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)
: __current_(std::move(__current)), __parent_(std::addressof(__parent)) {}

friend class filter_view<_View, _Pred>;

public:
using iterator_concept =
_If<bidirectional_range<_View>,
bidirectional_iterator_tag,
Expand All @@ -145,9 +151,6 @@ class filter_view<_View, _Pred>::__iterator : public __filter_iterator_category<
requires default_initializable<iterator_t<_View>>
= default;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)
: __current_(std::move(__current)), __parent_(std::addressof(__parent)) {}

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> const& base() const& noexcept { return __current_; }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() && { return std::move(__current_); }

Expand Down Expand Up @@ -211,13 +214,16 @@ class filter_view<_View, _Pred>::__iterator : public __filter_iterator_category<
template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
class filter_view<_View, _Pred>::__sentinel {
public:
private:
sentinel_t<_View> __end_ = sentinel_t<_View>();

_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(filter_view& __parent) : __end_(ranges::end(__parent.__base_)) {}

friend class filter_view<_View, _Pred>;

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_View> base() const { return __end_; }

_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(__iterator const& __x, __sentinel const& __y) {
Expand Down
15 changes: 9 additions & 6 deletions libcxx/include/__ranges/iota_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ template <weakly_incrementable _Start, semiregular _BoundSentinel = unreachable_
requires __weakly_equality_comparable_with<_Start, _BoundSentinel> && copyable<_Start>
class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
struct __iterator : public __iota_iterator_category<_Start> {
private:
_Start __value_ = _Start();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}

public:
friend class iota_view;

using iterator_concept =
Expand All @@ -124,14 +130,10 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
using value_type = _Start;
using difference_type = _IotaDiffT<_Start>;

_Start __value_ = _Start();

_LIBCPP_HIDE_FROM_ABI __iterator()
requires default_initializable<_Start>
= default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Start operator*() const
noexcept(is_nothrow_copy_constructible_v<_Start>) {
return __value_;
Expand Down Expand Up @@ -282,11 +284,12 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
private:
_BoundSentinel __bound_sentinel_ = _BoundSentinel();

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;
_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_BoundSentinel __bound_sentinel)
: __bound_sentinel_(std::move(__bound_sentinel)) {}

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
return __x.__value_ == __y.__bound_sentinel_;
}
Expand Down
8 changes: 5 additions & 3 deletions libcxx/include/__ranges/istream_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ class basic_istream_view<_Val, _CharT, _Traits>::__iterator {
using difference_type = ptrdiff_t;
using value_type = _Val;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(basic_istream_view<_Val, _CharT, _Traits>& __parent) noexcept
: __parent_(std::addressof(__parent)) {}

__iterator(const __iterator&) = delete;
_LIBCPP_HIDE_FROM_ABI __iterator(__iterator&&) = default;

Expand All @@ -91,9 +88,14 @@ class basic_istream_view<_Val, _CharT, _Traits>::__iterator {
private:
basic_istream_view<_Val, _CharT, _Traits>* __parent_;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(basic_istream_view<_Val, _CharT, _Traits>& __parent) noexcept
: __parent_(std::addressof(__parent)) {}

_LIBCPP_HIDE_FROM_ABI constexpr basic_istream<_CharT, _Traits>* __get_parent_stream() const {
return __parent_->__stream_;
}

friend class basic_istream_view<_Val, _CharT, _Traits>;
};

template <class _Val>
Expand Down
6 changes: 4 additions & 2 deletions libcxx/include/__ranges/join_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ struct join_view<_View>::__sentinel {
using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
sentinel_t<_Base> __end_ = sentinel_t<_Base>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_Parent& __parent) : __end_(ranges::end(__parent.__base_)) {}

friend class join_view<_View>;

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_Parent& __parent) : __end_(ranges::end(__parent.__base_)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __s)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__s.__end_)) {}
Expand Down
24 changes: 14 additions & 10 deletions libcxx/include/__ranges/lazy_split_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
template <bool _Const>
struct __outer_iterator : __outer_iterator_category<__maybe_const<_Const, _View>> {
private:
friend class lazy_split_view<_View, _Pattern>;

template <bool>
friend struct __inner_iterator;
friend __outer_iterator<true>;
Expand All @@ -155,6 +157,14 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
_LIBCPP_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
bool __trailing_empty_ = false;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __outer_iterator(_Parent& __parent)
requires(!forward_range<_Base>)
: __parent_(std::addressof(__parent)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator(_Parent& __parent, iterator_t<_Base> __current)
requires forward_range<_Base>
: __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto& __current() noexcept {
if constexpr (forward_range<_View>) {
return __current_;
Expand Down Expand Up @@ -196,14 +206,6 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>

_LIBCPP_HIDE_FROM_ABI __outer_iterator() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __outer_iterator(_Parent& __parent)
requires(!forward_range<_Base>)
: __parent_(std::addressof(__parent)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator(_Parent& __parent, iterator_t<_Base> __current)
requires forward_range<_Base>
: __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator(__outer_iterator<!_Const> __i)
requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
: __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
Expand Down Expand Up @@ -286,12 +288,16 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
template <bool _Const>
struct __inner_iterator : __inner_iterator_category<__maybe_const<_Const, _View>> {
private:
friend class lazy_split_view<_View, _Pattern>;

using _Base _LIBCPP_NODEBUG = __maybe_const<_Const, _View>;
// Workaround for a GCC issue.
static constexpr bool _OuterConst = _Const;
__outer_iterator<_Const> __i_ = __outer_iterator<_OuterConst>();
bool __incremented_ = false;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}

// Note: these private functions are necessary because GCC doesn't allow calls to private members of `__i_` from
// free functions that are friends of `inner-iterator`.

Expand Down Expand Up @@ -342,8 +348,6 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>

_LIBCPP_HIDE_FROM_ABI __inner_iterator() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept {
return __i_.__current();
}
Expand Down
18 changes: 11 additions & 7 deletions libcxx/include/__ranges/split_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ struct split_view<_View, _Pattern>::__iterator {
_LIBCPP_NO_UNIQUE_ADDRESS subrange<iterator_t<_View>> __next_ = subrange<iterator_t<_View>>();
bool __trailing_empty_ = false;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(
split_view<_View, _Pattern>& __parent, iterator_t<_View> __current, subrange<iterator_t<_View>> __next)
: __parent_(std::addressof(__parent)), __cur_(std::move(__current)), __next_(std::move(__next)) {}

friend class split_view<_View, _Pattern>;

friend struct __sentinel;

public:
Expand All @@ -137,10 +143,6 @@ struct split_view<_View, _Pattern>::__iterator {

_LIBCPP_HIDE_FROM_ABI __iterator() = default;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(
split_view<_View, _Pattern>& __parent, iterator_t<_View> __current, subrange<iterator_t<_View>> __next)
: __parent_(std::addressof(__parent)), __cur_(std::move(__current)), __next_(std::move(__next)) {}

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> base() const { return __cur_; }

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return {__cur_, __next_.begin()}; }
Expand Down Expand Up @@ -179,16 +181,18 @@ struct split_view<_View, _Pattern>::__sentinel {
private:
_LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_View> __end_ = sentinel_t<_View>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(split_view<_View, _Pattern>& __parent)
: __end_(ranges::end(__parent.__base_)) {}

_LIBCPP_HIDE_FROM_ABI static constexpr bool __equals(const __iterator& __x, const __sentinel& __y) {
return __x.__cur_ == __y.__end_ && !__x.__trailing_empty_;
}

friend class split_view<_View, _Pattern>;

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(split_view<_View, _Pattern>& __parent)
: __end_(ranges::end(__parent.__base_)) {}

_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
return __equals(__x, __y);
}
Expand Down
6 changes: 4 additions & 2 deletions libcxx/include/__ranges/take_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,16 @@ class take_view<_View>::__sentinel {
using _Iter _LIBCPP_NODEBUG = counted_iterator<iterator_t<__maybe_const<_OtherConst, _View>>>;
_LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}

friend class take_view<_View>;

template <bool>
friend class take_view<_View>::__sentinel;

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}

_LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __s)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__s.__end_)) {}
Expand Down
8 changes: 5 additions & 3 deletions libcxx/include/__ranges/take_while_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ class take_while_view<_View, _Pred>::__sentinel {
sentinel_t<_Base> __end_ = sentinel_t<_Base>();
const _Pred* __pred_ = nullptr;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end, const _Pred* __pred)
: __end_(std::move(__end)), __pred_(__pred) {}

friend class take_while_view<_View, _Pred>;

friend class __sentinel<!_Const>;

public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end, const _Pred* __pred)
: __end_(std::move(__end)), __pred_(__pred) {}

_LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __s)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__s.__end_)), __pred_(__s.__pred_) {}
Expand Down
14 changes: 9 additions & 5 deletions libcxx/include/__ranges/transform_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ class transform_view<_View, _Fn>::__iterator

_Parent* __parent_ = nullptr;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current)
: __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}

friend class transform_view<_View, _Fn>;

template <bool>
friend class transform_view<_View, _Fn>::__iterator;

Expand All @@ -209,9 +214,6 @@ class transform_view<_View, _Fn>::__iterator
requires default_initializable<iterator_t<_Base>>
= default;

_LIBCPP_HIDE_FROM_ABI constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current)
: __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}

// Note: `__i` should always be `__iterator<false>`, but directly using
// `__iterator<false>` is ill-formed when `_Const` is false
// (see http://wg21.link/class.copy.ctor#5).
Expand Down Expand Up @@ -354,6 +356,10 @@ class transform_view<_View, _Fn>::__sentinel {

sentinel_t<_Base> __end_ = sentinel_t<_Base>();

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {}

friend class transform_view<_View, _Fn>;

template <bool>
friend class transform_view<_View, _Fn>::__iterator;

Expand All @@ -363,8 +369,6 @@ class transform_view<_View, _Fn>::__sentinel {
public:
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;

_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {}

// Note: `__i` should always be `__sentinel<false>`, but directly using
// `__sentinel<false>` is ill-formed when `_Const` is false
// (see http://wg21.link/class.copy.ctor#5).
Expand Down
Loading
Loading