From d9a2e5691977cd9e70794a9141cf19216acae7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Thu, 23 Jan 2025 22:46:55 +0000 Subject: [PATCH] restored using allocator traits for the special case --- include/beman/lazy/detail/allocator_support.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/beman/lazy/detail/allocator_support.hpp b/include/beman/lazy/detail/allocator_support.hpp index 996b0ab..568f027 100644 --- a/include/beman/lazy/detail/allocator_support.hpp +++ b/include/beman/lazy/detail/allocator_support.hpp @@ -48,7 +48,8 @@ struct allocator_support { template static void* operator new(std::size_t size, A&&... a) { if constexpr (::std::same_as>) { - return ::operator new(size); + Allocator alloc{}; + return allocator_traits::allocate(alloc, size); } else { Allocator alloc{::beman::lazy::detail::find_allocator(a...)}; @@ -63,7 +64,8 @@ struct allocator_support { } static void operator delete(void* ptr, std::size_t size) { if constexpr (::std::same_as>) { - ::operator delete(ptr, size); + Allocator alloc{}; + allocator_traits::deallocate(alloc, static_cast(ptr), size); } else { Allocator* aptr{allocator_support::get_allocator(ptr, size)}; Allocator alloc{*aptr};