diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-27 21:58:09 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-27 21:58:09 -0500 |
| commit | c9db77a8f789858b9e1ceb60edb5c463b30451ed (patch) | |
| tree | 56d05ff4bc9dcb99b2e9c9b7332ebd43f42a0be1 | |
| parent | a4b5630c58717b56b2b362bb5296dc4cb92c68c4 (diff) | |
add macro for defining char arrays on the stack
| -rw-r--r-- | src/macros.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/macros.hpp b/src/macros.hpp index aaf5590..5fc7f3b 100644 --- a/src/macros.hpp +++ b/src/macros.hpp @@ -8,6 +8,8 @@ #define CAFE_BABE(T) reinterpret_cast<T *>(0xCAFEBABE) +#define NULL_CHAR_ARR(v, len) char v[len]; v[0] = '\0'; v[len-1] = '\0'; + #define IS_CONSTRUCTIBLE(T) constexpr(std::is_default_constructible<T>::value && !std::is_integral<T>::value && !std::is_floating_point<T>::value) #define IS_DESTRUCTIBLE(T) constexpr(std::is_destructible<T>::value && !std::is_integral<T>::value && !std::is_floating_point<T>::value && !std::is_array<T>::value) |
