Skip to content

Commit 526e301

Browse files
authored
Merge pull request #251 from elbeno/fix-static-assert-capture
🐛 Fix `STATIC_ASSERT` capture spec
2 parents dace94f + de17ac3 commit 526e301

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/stdx/static_assert.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ template <bool B> constexpr auto ct_check = ct_check_t<B>{};
2929

3030
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
3131
#define STATIC_ASSERT(cond, ...) \
32-
[]<bool B>() -> bool { \
32+
[&]<bool B>() -> bool { \
3333
STDX_PRAGMA(diagnostic push) \
3434
STDX_PRAGMA(diagnostic ignored "-Wunknown-warning-option") \
3535
STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") \
@@ -43,7 +43,7 @@ template <bool B> constexpr auto ct_check = ct_check_t<B>{};
4343

4444
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
4545
#define STATIC_ASSERT(cond, ...) \
46-
[]<bool B>() -> bool { \
46+
[&]<bool B>() -> bool { \
4747
constexpr auto S = STDX_CT_FORMAT(__VA_ARGS__); \
4848
stdx::ct_check<B>.template emit<S>(); \
4949
return B; \

0 commit comments

Comments
 (0)