[libcxx-commits] [libcxx] [libc++] P3168R2 Give std::optional Range Support (PR #146491)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 1 06:35:22 PDT 2025
================
@@ -578,6 +600,120 @@ struct __is_std_optional : false_type {};
template <class _Tp>
struct __is_std_optional<optional<_Tp>> : true_type {};
+# if _LIBCPP_STD_VER >= 26
+
+template <class _T>
+constexpr bool ranges::enable_view<optional<_T>> = true;
+
+template <class _T>
+constexpr auto format_kind<optional<_T>> = range_format::disabled;
+
+template <typename _Tp>
----------------
philnik777 wrote:
Please add tests to make sure that the iterator fulfills all the iterator requirements.
https://github.com/llvm/llvm-project/pull/146491
More information about the libcxx-commits
mailing list