We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3c92e1 commit 09fdd4cCopy full SHA for 09fdd4c
include/swift/Basic/Lazy.h
@@ -74,10 +74,10 @@ template <typename T> inline T &Lazy<T>::get(void (*initCallback)(void*)) {
74
} // namespace swift
75
76
#define SWIFT_LAZY_CONSTANT(INITIAL_VALUE) \
77
- ({ \
+ ([]{ \
78
using T = ::std::remove_reference<decltype(INITIAL_VALUE)>::type; \
79
static ::swift::Lazy<T> TheLazy; \
80
- TheLazy.get([](void *ValueAddr){ ::new(ValueAddr) T{INITIAL_VALUE}; });\
81
- })
+ return TheLazy.get([](void *ValueAddr){ ::new(ValueAddr) T{INITIAL_VALUE}; });\
+ }())
82
83
#endif // SWIFT_BASIC_LAZY_H
0 commit comments