From 032c9a4251db8a913100ddb3156651e5dd38803a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 10 Apr 2022 03:02:57 -0500 Subject: [PATCH] [ox/std] Add std::construct_at (synced from cf7f9b9088ad6f51a13eeccd6816c0ea47027c23) --- src/ox/std/memory.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ox/std/memory.hpp b/src/ox/std/memory.hpp index f2d4ee8f2..92abf9658 100644 --- a/src/ox/std/memory.hpp +++ b/src/ox/std/memory.hpp @@ -28,6 +28,11 @@ struct allocator { } }; +template +constexpr T *construct_at(T *p, Args &&...args ) { + return new (p) T(ox::forward(args)...); +} + } #endif