Skip to content

Commit

Permalink
Fixed etl::optional operator =() for invalid values with non-pod types
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Dec 15, 2023
1 parent dd060d5 commit 8f88aa0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/etl/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,11 @@ namespace etl
{
if (this != &other)
{
storage.value = etl::move(other.storage.value);
if (other.has_value())
{
storage.value = etl::move(other.storage.value);
}

valid = other.valid;
}

Expand Down

0 comments on commit 8f88aa0

Please sign in to comment.