diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-02-17 00:21:48 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-02-17 22:29:50 +0100 |
commit | a141c401f78467bc15f62882fca5d55a007cacbb (patch) | |
tree | 908ac71a8640f78f45d22c6808c5fa6e373000fa /asl/layout.hpp | |
parent | cb77cbe9ce4cddad6a460aa190ff70f0c13e4703 (diff) |
Reorganize everything
Diffstat (limited to 'asl/layout.hpp')
-rw-r--r-- | asl/layout.hpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/asl/layout.hpp b/asl/layout.hpp deleted file mode 100644 index 0201e94..0000000 --- a/asl/layout.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "asl/integers.hpp" -#include "asl/meta.hpp" - -namespace asl -{ - -template<typename T> -inline constexpr isize_t size_of = static_cast<isize_t>(sizeof(T)); - -template<typename T> -inline constexpr isize_t align_of = static_cast<isize_t>(alignof(T)); - -struct layout -{ - isize_t size; - isize_t align; - - constexpr bool operator==(const layout&) const = default; - - template<is_object T> - static constexpr layout of() - { - return layout{ size_of<T>, align_of<T> }; - } - - template<is_object T> - static constexpr layout array(isize_t size) - { - return layout{ size_of<T> * size, align_of<T> }; - } -}; - -} // namespace asl - -#define AslOffsetOf(S, M) (static_cast<isize_t>(__builtin_offsetof(S, M))) |