Skip to content

Commit 10edf7f

Browse files
Merge pull request #23 from Bronek/no_capture
Replace capture with pairs parameter
2 parents 529f6ec + 9236a41 commit 10edf7f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

antithesis_sdk.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -914,17 +914,17 @@ namespace { // Anonymous namespace which is translation-unit-specific; certain s
914914
#define SOMETIMES_LESS_THAN_OR_EQUAL_TO(val, threshold, message, ...) \
915915
ANTITHESIS_SDK_SOMETIMES_POLYFILL((val <= threshold), message, __VA_ARGS__)
916916
#define ALWAYS_SOME(pairs, message, ...) \
917-
ANTITHESIS_SDK_ALWAYS_POLYFILL(([&](){ \
918-
std::initializer_list<std::pair<std::string, bool>> ps = pairs; \
917+
ANTITHESIS_SDK_ALWAYS_POLYFILL(([]( \
918+
std::initializer_list<std::pair<std::string, bool>> ps){ \
919919
for (auto const& pair : ps) \
920920
if (pair.second) return true; \
921-
return false; }()), message, __VA_ARGS__)
921+
return false; }(pairs)), message, __VA_ARGS__)
922922
#define SOMETIMES_ALL(pairs, message, ...) \
923-
ANTITHESIS_SDK_SOMETIMES_POLYFILL(([&](){ \
924-
std::initializer_list<std::pair<std::string, bool>> ps = pairs; \
923+
ANTITHESIS_SDK_SOMETIMES_POLYFILL(([]( \
924+
std::initializer_list<std::pair<std::string, bool>> ps){ \
925925
for (auto const& pair : ps) \
926926
if (!pair.second) return false; \
927-
return true; }()), message, __VA_ARGS__)
927+
return true; }(pairs)), message, __VA_ARGS__)
928928

929929
#else
930930

0 commit comments

Comments
 (0)