diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/aloptional.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/common/aloptional.h b/common/aloptional.h index 609c10c7..150d06c7 100644 --- a/common/aloptional.h +++ b/common/aloptional.h @@ -24,12 +24,11 @@ template<typename T, bool = std::is_trivially_destructible<T>::value> struct optstore_base { bool mHasValue{false}; union { - char mDummy; + char mDummy{}; T mValue; }; optstore_base() noexcept { } - optstore_base(nullopt_t) noexcept { } template<typename ...Args> explicit optstore_base(in_place_t, Args&& ...args) noexcept(std::is_nothrow_constructible<T, Args...>::value) @@ -43,12 +42,11 @@ template<typename T> struct optstore_base<T, false> { bool mHasValue{false}; union { - char mDummy; + char mDummy{}; T mValue; }; optstore_base() noexcept { } - optstore_base(nullopt_t) noexcept { } template<typename ...Args> explicit optstore_base(in_place_t, Args&& ...args) noexcept(std::is_nothrow_constructible<T, Args...>::value) @@ -230,7 +228,7 @@ public: optional() = default; optional(const optional&) = default; optional(optional&&) = default; - optional(nullopt_t) noexcept : mStore{nullopt} { } + optional(nullopt_t) noexcept { } template<typename ...Args> explicit optional(in_place_t, Args&& ...args) : mStore{al::in_place, std::forward<Args>(args)...} |