From 6f4cc3e754c24306493e5840c61ca4246d04428f Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Mon, 25 Aug 2025 11:38:53 -0700 Subject: [PATCH 1/4] fix: add this --- include/svs/lib/misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/svs/lib/misc.h b/include/svs/lib/misc.h index b0293443..d226fe3f 100644 --- a/include/svs/lib/misc.h +++ b/include/svs/lib/misc.h @@ -343,7 +343,7 @@ template class Lazy : public Fs... { using Fs::operator()...; }; -#define SVS_LAZY(expr) svs::lib::Lazy([=]() { return expr; }) +#define SVS_LAZY(expr) svs::lib::Lazy([=, this]() { return expr; }) template inline constexpr bool is_lazy = false; template inline constexpr bool is_lazy> = true; From 4705cc95aa9c629a1459596ae1b9b7e69df9a67f Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Mon, 25 Aug 2025 11:51:08 -0700 Subject: [PATCH 2/4] fix: try both wih this and fall back to without this --- include/svs/lib/misc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/svs/lib/misc.h b/include/svs/lib/misc.h index d226fe3f..292bbb16 100644 --- a/include/svs/lib/misc.h +++ b/include/svs/lib/misc.h @@ -343,7 +343,11 @@ template class Lazy : public Fs... { using Fs::operator()...; }; -#define SVS_LAZY(expr) svs::lib::Lazy([=, this]() { return expr; }) +#ifdef __cpp_capture_star_this + #define SVS_LAZY(expr) svs::lib::Lazy([=, this]() { return expr; }) +#else + #define SVS_LAZY(expr) svs::lib::Lazy([=]() { return expr; }) +#endif template inline constexpr bool is_lazy = false; template inline constexpr bool is_lazy> = true; From a30d6a85cf47d619f340aa38b8cbd36d54a80dbe Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Mon, 25 Aug 2025 12:21:59 -0700 Subject: [PATCH 3/4] fix: add svs lazy mamber --- include/svs/lib/misc.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/svs/lib/misc.h b/include/svs/lib/misc.h index 292bbb16..c0176da4 100644 --- a/include/svs/lib/misc.h +++ b/include/svs/lib/misc.h @@ -343,11 +343,8 @@ template class Lazy : public Fs... { using Fs::operator()...; }; -#ifdef __cpp_capture_star_this - #define SVS_LAZY(expr) svs::lib::Lazy([=, this]() { return expr; }) -#else - #define SVS_LAZY(expr) svs::lib::Lazy([=]() { return expr; }) -#endif +#define SVS_LAZY_MEMBER(expr) svs::lib::Lazy([=, this]() { return expr; }) +#define SVS_LAZY(expr) svs::lib::Lazy([=]() { return expr; }) template inline constexpr bool is_lazy = false; template inline constexpr bool is_lazy> = true; From d558e78107370f582f6b19a20a17b8c6a5f2a37d Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Mon, 25 Aug 2025 15:28:47 -0700 Subject: [PATCH 4/4] fix: try a nother solution --- include/svs/lib/misc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/svs/lib/misc.h b/include/svs/lib/misc.h index c0176da4..7ebe48a5 100644 --- a/include/svs/lib/misc.h +++ b/include/svs/lib/misc.h @@ -343,8 +343,7 @@ template class Lazy : public Fs... { using Fs::operator()...; }; -#define SVS_LAZY_MEMBER(expr) svs::lib::Lazy([=, this]() { return expr; }) -#define SVS_LAZY(expr) svs::lib::Lazy([=]() { return expr; }) +#define SVS_LAZY(expr) svs::lib::Lazy([&]() { return expr; }) template inline constexpr bool is_lazy = false; template inline constexpr bool is_lazy> = true;