mirror of
https://gitea.windcorp.ru/Wind-Corporation/Progressia.git
synced 2025-12-15 23:18:32 +03:00
Initial commit
This commit is contained in:
30
main/util.h
Normal file
30
main/util.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
// clang-format off
|
||||
#define FOR_PACK(PACK_TYPE, PACK_NAME, VAR, CODE) \
|
||||
{ \
|
||||
[[maybe_unused]] int dummy[] { \
|
||||
( \
|
||||
[&](PACK_TYPE VAR) { \
|
||||
CODE; \
|
||||
return 0; \
|
||||
} \
|
||||
)(PACK_NAME)... \
|
||||
}; \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
#define FOR_PACK_S(PACK_TYPE, VAR_TYPE, CODE) \
|
||||
{ \
|
||||
[[maybe_unused]] int dummy[] { \
|
||||
( \
|
||||
[&]() { \
|
||||
using VAR_TYPE = PACK_TYPE; \
|
||||
CODE; \
|
||||
return 0; \
|
||||
} \
|
||||
)()... \
|
||||
}; \
|
||||
}
|
||||
// clang-format on
|
||||
Reference in New Issue
Block a user