forked from TartanLlama/optional
Remove some hard resets
This commit is contained in:
@@ -368,7 +368,7 @@ struct optional_copy_base<T, false> : optional_operations_base<T> {
|
|||||||
if (rhs.has_value()) {
|
if (rhs.has_value()) {
|
||||||
this->construct(rhs.get());
|
this->construct(rhs.get());
|
||||||
} else {
|
} else {
|
||||||
this->hard_reset();
|
this->m_has_value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ template <class T> struct optional_move_base<T, false> : optional_copy_base<T> {
|
|||||||
if (rhs.has_value()) {
|
if (rhs.has_value()) {
|
||||||
this->construct(std::move(rhs.get()));
|
this->construct(std::move(rhs.get()));
|
||||||
} else {
|
} else {
|
||||||
this->hard_reset();
|
this->m_has_value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
optional_move_base &operator=(const optional_move_base &rhs) = default;
|
optional_move_base &operator=(const optional_move_base &rhs) = default;
|
||||||
|
Reference in New Issue
Block a user