Skip to content

Commit

Permalink
New version of optional
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jan 19, 2020
1 parent 4901209 commit c4a77de
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/jsoncons/detail/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,6 @@ namespace detail
destroy();
}

void destroy() noexcept
{
if (has_value_)
{
value_.~T();
has_value_ = false;
}
}

optional& operator=( const optional& other ) = default;

optional& operator=(optional&& other ) = default;
Expand Down Expand Up @@ -238,6 +229,15 @@ namespace detail
has_value_ = true;
}

void destroy() noexcept
{
if (has_value_)
{
value_.~T();
has_value_ = false;
}
}

template <typename U>
void assign(U&& u)
{
Expand Down

0 comments on commit c4a77de

Please sign in to comment.