[libcxx-commits] [libcxx] [libc++] P3798R1: The unexpected in std::expected (PR #204826)

Alex Kremer via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 21 16:48:16 PDT 2026


================
@@ -1599,6 +1603,10 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return this->__has_val(); }
 
+#  if _LIBCPP_STD_VER >= 29 
----------------
godexsoft wrote:

I'm assuming that this makes it unavailable in C++23 and C++26.. when we discussed the paper in LEWG we were hoping to backport this as a DR into 23/26. The conclusion was that compilers often do this without being asked. What do you think, should we remove these conditional? is this common practice?

https://github.com/llvm/llvm-project/pull/204826


More information about the libcxx-commits mailing list