diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2021-10-08 11:05:36 -0700 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2021-10-08 11:05:36 -0700 |
commit | e3b8f8fe272503ef7f738da2f577f68b0fe16eeb (patch) | |
tree | dbcedc04132f1471f651984f9b5726678cca3443 /common/aloptional.h | |
parent | 8da4eaff29972aca8932c75084d1f1698da5e762 (diff) |
Make a construct_at method amd use it
Diffstat (limited to 'common/aloptional.h')
-rw-r--r-- | common/aloptional.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/aloptional.h b/common/aloptional.h index a8ca18ba..0eafd4d1 100644 --- a/common/aloptional.h +++ b/common/aloptional.h @@ -58,9 +58,9 @@ class optional { storage_t mStore; template<typename... Args> - void doConstruct(Args&& ...args) + void doConstruct(Args&& ...args) noexcept(noexcept(al::construct_at(std::declval<T*>(), std::forward<Args>(args)...))) { - ::new(std::addressof(mStore.mValue)) T{std::forward<Args>(args)...}; + al::construct_at(std::addressof(mStore.mValue), std::forward<Args>(args)...); mStore.mHasValue = true; } |