summaryrefslogtreecommitdiff
path: root/asl/maybe_uninit.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'asl/maybe_uninit.hpp')
-rw-r--r--asl/maybe_uninit.hpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/asl/maybe_uninit.hpp b/asl/maybe_uninit.hpp
index 0ab09ee..cedd96f 100644
--- a/asl/maybe_uninit.hpp
+++ b/asl/maybe_uninit.hpp
@@ -47,16 +47,13 @@ public:
template<typename... Args>
constexpr void init_unsafe(Args&&... args) &
{
- new(uninit_ptr()) T(ASL_FWD(args)...);
+ construct_at<T>(uninit_ptr(), ASL_FWD(args)...);
}
// @Safety Must be called only when in initialized state.
constexpr void uninit_unsafe() &
{
- if constexpr (!trivially_destructible<T>)
- {
- init_ptr_unsafe()->~T();
- }
+ destruct(init_ptr_unsafe());
}
};