diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-11-19 00:08:33 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | d241eaf1b209dcfb05656842dd6250067b704d99 (patch) | |
tree | 49f34f6226f4614611d16ba6332b1b50b51a4712 /asl/layout.hpp | |
parent | 58200ce939a591008a8d9406f437252ce2b175cf (diff) |
Add allocator, start work on box
Diffstat (limited to 'asl/layout.hpp')
-rw-r--r-- | asl/layout.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/asl/layout.hpp b/asl/layout.hpp index 06fbe10..2295a1c 100644 --- a/asl/layout.hpp +++ b/asl/layout.hpp @@ -24,6 +24,12 @@ struct layout {
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
|