Skip to content

Commit 5c60392

Browse files
committed
Rename pointer type and unguard it
1 parent 718af43 commit 5c60392

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

libcxx/include/optional

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -612,20 +612,18 @@ class _LIBCPP_DECLSPEC_EMPTY_BASES optional
612612
private __optional_sfinae_assign_base_t<_Tp> {
613613
using __base _LIBCPP_NODEBUG = __optional_move_assign_base<_Tp>;
614614

615-
# if _LIBCPP_STD_VER >= 26
616-
using pointer = std::add_pointer_t<_Tp>;
617-
using const_pointer = std::add_pointer_t<const _Tp>;
618-
# endif
615+
using __pointer _LIBCPP_NODEBUG = std::add_pointer_t<_Tp>;
616+
using __const_pointer _LIBCPP_NODEBUG = std::add_pointer_t<const _Tp>;
619617

620618
public:
621619
using value_type = _Tp;
622620
# if _LIBCPP_STD_VER >= 26
623621
# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
624-
using iterator = __bounded_iter<__wrap_iter<pointer>>;
625-
using const_iterator = __bounded_iter<__wrap_iter<const_pointer>>;
622+
using iterator = __bounded_iter<__wrap_iter<__pointer>>;
623+
using const_iterator = __bounded_iter<__wrap_iter<__const_pointer>>;
626624
# else
627-
using iterator = __wrap_iter<pointer>;
628-
using const_iterator = __wrap_iter<const_pointer>;
625+
using iterator = __wrap_iter<__pointer>;
626+
using const_iterator = __wrap_iter<__const_pointer>;
629627
# endif
630628
# endif
631629

@@ -837,9 +835,9 @@ public:
837835
_LIBCPP_HIDE_FROM_ABI constexpr iterator begin() noexcept {
838836
# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
839837
return std::__make_bounded_iter(
840-
std::__wrap_iter<pointer>(std::addressof(this->__get())),
841-
std::__wrap_iter<pointer>(std::addressof(this->__get())),
842-
std::__wrap_iter<pointer>(std::addressof(this->__get()) + (this->has_value() ? 1 : 0)));
838+
std::__wrap_iter<__pointer>(std::addressof(this->__get())),
839+
std::__wrap_iter<__pointer>(std::addressof(this->__get())),
840+
std::__wrap_iter<__pointer>(std::addressof(this->__get()) + (this->has_value() ? 1 : 0)));
843841
# else
844842
return iterator(std::addressof(this->__get()));
845843
# endif
@@ -848,9 +846,9 @@ public:
848846
_LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
849847
# ifdef _LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL
850848
return std::__make_bounded_iter(
851-
std::__wrap_iter<const_pointer>(std::addressof(this->__get())),
852-
std::__wrap_iter<const_pointer>(std::addressof(this->__get())),
853-
std::__wrap_iter<const_pointer>(std::addressof(this->__get()) + (this->has_value() ? 1 : 0)));
849+
std::__wrap_iter<__const_pointer>(std::addressof(this->__get())),
850+
std::__wrap_iter<__const_pointer>(std::addressof(this->__get())),
851+
std::__wrap_iter<__const_pointer>(std::addressof(this->__get()) + (this->has_value() ? 1 : 0)));
854852
# else
855853
return const_iterator(std::addressof(this->__get()));
856854
# endif

0 commit comments

Comments
 (0)