From cf7f9b9088ad6f51a13eeccd6816c0ea47027c23 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 --- deps/ox/src/ox/std/memory.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deps/ox/src/ox/std/memory.hpp b/deps/ox/src/ox/std/memory.hpp index f2d4ee8f..92abf965 100644 --- a/deps/ox/src/ox/std/memory.hpp +++ b/deps/ox/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