[libcxx-commits] [libcxx] [libc++] Fix constraints for `optional`'s constructors taking `in_place_t` and related `make_optional` overloads (PR #173467)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 3 06:45:52 PST 2026


================
@@ -873,13 +895,16 @@ public:
   _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&)      = default;
   _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {}
 
-  template <class _InPlaceT,
-            class... _Args,
-            enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, is_constructible<_Tp, _Args...>>::value, int> = 0>
+  template <
+      class _InPlaceT,
----------------
huixie90 wrote:

question: why is this a template parameter instead of passing `in_place_t` like other overloads?

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


More information about the libcxx-commits mailing list