diff --git a/optional.hpp b/optional.hpp index 396a5b7..74b8d5c 100644 --- a/optional.hpp +++ b/optional.hpp @@ -368,7 +368,7 @@ struct optional_copy_base : optional_operations_base { if (rhs.has_value()) { this->construct(rhs.get()); } else { - this->hard_reset(); + this->m_has_value = false; } } @@ -398,7 +398,7 @@ template struct optional_move_base : optional_copy_base { if (rhs.has_value()) { this->construct(std::move(rhs.get())); } else { - this->hard_reset(); + this->m_has_value = false; } } optional_move_base &operator=(const optional_move_base &rhs) = default;