Get rid of warnings in nullable.hpp (#3617)

This commit is contained in:
JinmingHu 2022-05-05 07:10:34 +08:00 committed by GitHub
parent e010b9176b
commit b9fb5efb6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ public:
* @param other Another `%Nullable` instance to copy.
*/
Nullable(const Nullable& other) noexcept(std::is_nothrow_copy_constructible<T>::value)
: m_hasValue(other.m_hasValue)
: m_disengaged{}, m_hasValue(other.m_hasValue)
{
if (m_hasValue)
{
@ -73,7 +73,7 @@ public:
* @param other A `%Nullable` instance to move into the instance being constructed.
*/
Nullable(Nullable&& other) noexcept(std::is_nothrow_move_constructible<T>::value)
: m_hasValue(other.m_hasValue)
: m_disengaged{}, m_hasValue(other.m_hasValue)
{
if (m_hasValue)
{