From a141c401f78467bc15f62882fca5d55a007cacbb Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 17 Feb 2025 00:21:48 +0100 Subject: Reorganize everything --- asl/layout.hpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 asl/layout.hpp (limited to 'asl/layout.hpp') 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 -inline constexpr isize_t size_of = static_cast(sizeof(T)); - -template -inline constexpr isize_t align_of = static_cast(alignof(T)); - -struct layout -{ - isize_t size; - isize_t align; - - constexpr bool operator==(const layout&) const = default; - - template - static constexpr layout of() - { - return layout{ size_of, align_of }; - } - - template - static constexpr layout array(isize_t size) - { - return layout{ size_of * size, align_of }; - } -}; - -} // namespace asl - -#define AslOffsetOf(S, M) (static_cast(__builtin_offsetof(S, M))) -- cgit