From 2228ee7005fdfe1d7dae01125b69a55c324ab309 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 10 Jul 2025 16:51:44 -0600 Subject: [PATCH] :bug: Make `CX_VALUE` capture-free Problem: - `CX_VALUE` without any capture clauses is important for use cases where the lambda has to be default constructible. Solution: - Remove the remaining default capture clauses from `CX_VALUE`. --- include/stdx/utility.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stdx/utility.hpp b/include/stdx/utility.hpp index 1478f97..8607aef 100644 --- a/include/stdx/utility.hpp +++ b/include/stdx/utility.hpp @@ -242,14 +242,14 @@ template constexpr auto is_ct_v = is_ct_v; ::stdx::cxv_detail::from_any( \ __VA_ARGS__)>())::value) { \ return ::stdx::overload{ \ - ::stdx::cxv_detail::cx_base{}, [&] { \ + ::stdx::cxv_detail::cx_base{}, [] { \ return ::stdx::type_identity< \ decltype(::stdx::cxv_detail::type_of< \ ::stdx::cxv_detail::from_any( \ __VA_ARGS__)>())>{}; \ }}; \ } else { \ - return ::stdx::overload{::stdx::cxv_detail::cx_base{}, [&] { \ + return ::stdx::overload{::stdx::cxv_detail::cx_base{}, [] { \ return (__VA_ARGS__) + \ ::stdx::cxv_detail::type_val{}; \ }}; \