summaryrefslogtreecommitdiff
path: root/asl/option.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'asl/option.hpp')
-rw-r--r--asl/option.hpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/asl/option.hpp b/asl/option.hpp
index f2af9ee..b22b295 100644
--- a/asl/option.hpp
+++ b/asl/option.hpp
@@ -88,7 +88,7 @@ class option
if constexpr (kHasInlinePayload)
{
- new (&m_payload) T(ASL_FWD(args)...);
+ construct_at<T>(&m_payload, ASL_FWD(args)...);
}
else
{
@@ -389,11 +389,8 @@ public:
}
else
{
- if constexpr (!trivially_destructible<T>)
- {
- (&m_payload)->~T();
- }
- new (&m_payload) T(niche{});
+ destruct(&m_payload);
+ construct_at<T>(&m_payload, niche{});
}
}
else