From 64ebfde8bcd6408e3b6925624e8680c314db6efc Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 6 Feb 2025 19:54:38 +0100 Subject: get rid of nasty stdlib --- lib/nes/common/containers/box.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/nes/common/containers/box.hh') diff --git a/lib/nes/common/containers/box.hh b/lib/nes/common/containers/box.hh index 7bf2848..82f6448 100644 --- a/lib/nes/common/containers/box.hh +++ b/lib/nes/common/containers/box.hh @@ -2,6 +2,8 @@ #include "nes/common/types.hh" #include "nes/common/debug.hh" +#include "nes/common/utils.hh" +#include namespace nes { @@ -56,15 +58,15 @@ namespace nes operator bool() const { return has_value(); } auto has_value() const -> bool { return initialized_; } - auto get() -> T* { return has_value() ? std::launder(reinterpret_cast(buffer_)) : nullptr; } - auto get() const -> T const* { return has_value() ? std::launder(reinterpret_cast(buffer_)) : nullptr; } + auto get() -> T* { return has_value() ? launder(reinterpret_cast(buffer_)) : nullptr; } + auto get() const -> T const* { return has_value() ? launder(reinterpret_cast(buffer_)) : nullptr; } /// Construct a new value in-place, potentially replacing the old value. template auto emplace(Args&&... args) -> void { clear(); - new (buffer_) T(std::forward(args)...); + new (buffer_) T(args...); initialized_ = true; } -- cgit v1.3.1