[libcxx-commits] [libcxx] [libc++] Guard `optional::iterator` range variables behind experimental (PR #175222)
William Tran-Viet via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jan 9 11:09:20 PST 2026
https://github.com/smallp-o-p created https://github.com/llvm/llvm-project/pull/175222
None
>From 316c461d1d3f4a9e9191ea5c383cb8f0909a266e Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Fri, 9 Jan 2026 14:06:18 -0500
Subject: [PATCH] Guard range variables behind experimental optional iterator
---
libcxx/include/optional | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/optional b/libcxx/include/optional
index cc6a30151c53a..12fbcdfa5c5d6 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -661,7 +661,7 @@ using __optional_sfinae_assign_base_t _LIBCPP_NODEBUG =
template <class _Tp>
class optional;
-# if _LIBCPP_STD_VER >= 26
+# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
template <class _Tp>
constexpr bool ranges::enable_view<optional<_Tp>> = true;
More information about the libcxx-commits
mailing list