This commit is contained in:
2025-11-23 14:18:04 +05:30
parent 133f1ef52b
commit 536e10d129

View File

@ -220,12 +220,11 @@
// Templates and Aliases // Templates and Aliases
#ifdef __cplusplus #ifdef __cplusplus
#define ALIAS_FUNCTION(alias, function) \ # define ALIAS_FUNCTION(alias, function) \
template<typename... Args> \ template<typename... Args> auto alias(Args &&...args) -> decltype(function(std::forward<Args>(args)...)) \
auto alias(Args &&...args) -> decltype(function(std::forward<Args>(args)...)) \ { \
{ \ return function(std::forward<Args>(args)...); \
return function(std::forward<Args>(args)...); \ }
}
# define ALIAS_TEMPLATE_FUNCTION(t, alias, function) \ # define ALIAS_TEMPLATE_FUNCTION(t, alias, function) \
template<typename t, typename... Args> \ template<typename t, typename... Args> \
@ -271,6 +270,10 @@
#define IA_CONCAT(x, y) IA_CONCAT_IMPL(x, y) #define IA_CONCAT(x, y) IA_CONCAT_IMPL(x, y)
#define IA_UNIQUE_NAME(prefix) IA_CONCAT(prefix, __LINE__) #define IA_UNIQUE_NAME(prefix) IA_CONCAT(prefix, __LINE__)
#define ENSURE_BINARY_COMPATIBILITY(A, B) \
static_assert(sizeof(A) == sizeof(B), \
#A ", " #B " size mismatch! Do not add virtual functions or new member variables.");
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Limits & Versioning // Limits & Versioning
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------