diff options
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))) |