diff --git a/src/AFQMC/Memory/device_pointers.hpp b/src/AFQMC/Memory/device_pointers.hpp index a8813a14d7..a6825b0658 100644 --- a/src/AFQMC/Memory/device_pointers.hpp +++ b/src/AFQMC/Memory/device_pointers.hpp @@ -420,17 +420,20 @@ struct device_allocator bool operator==(device_allocator const& other) const { return true; } bool operator!=(device_allocator const& other) const { return false; } template - void construct(U p, Args&&... args) - {} - //{ - // ::new((void*)p) U(std::forward(args)...); - // } + void construct(U p, Args&&... args){ + static_assert( std::is_trivially_copy_constructible{}, "!"); // ::new((void*)p) U(std::forward(args)...); + } template - void destroy(U p) - {} - // { - // p->~U(); - // } + void destroy(U p){ + static_assert( std::is_trivially_destructible{}, "!"); // p->~U(); + } + template + ForwardIt alloc_uninitialized_copy(InputIt first, InputIt last, ForwardIt d_first){ + static_assert( std::is_trivially_copy_constructible{}, "!"); + static_assert( std::is_trivially_destructible{}, "!"); + std::advance( d_first , std::distance(first, last) ); + return d_first; + } }; struct memory_resource