From 22131693e1892c5477c998ab63bf476d152b17cb Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Wed, 1 Jan 2025 19:18:19 +0100 Subject: Implement move constructor for buffer --- asl/memory.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'asl/memory.hpp') diff --git a/asl/memory.hpp b/asl/memory.hpp index 0441c8c..cfc7057 100644 --- a/asl/memory.hpp +++ b/asl/memory.hpp @@ -36,7 +36,7 @@ constexpr T* construct_at(void* ptr, Args&&... args) } template -constexpr void destruct(T* data) +constexpr void destroy(T* data) { if constexpr (!trivially_destructible) { @@ -45,13 +45,13 @@ constexpr void destruct(T* data) } template -constexpr void destruct_n(T* data, isize_t n) +constexpr void destroy_n(T* data, isize_t n) { if constexpr (!trivially_destructible) { for (isize_t i = 0; i < n; ++i) { - destruct(data + i); + destroy(data + i); } } } @@ -71,7 +71,7 @@ constexpr void relocate_uninit_n(T* to, T* from, isize_t n) // NOLINTNEXTLINE(*-pointer-arithmetic) construct_at(to + i, ASL_MOVE(from[i])); } - destruct_n(from, n); + destroy_n(from, n); } } -- cgit