Skip to content

Commit

Permalink
Add reset() to set_value/to_value event consumers, closes #141
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Jul 29, 2023
1 parent de56743 commit 2f7ad8c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/tao/json/events/set_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ namespace tao::json::events
: value_( v )
{}

void reset() noexcept
{
value_.set_uninitialized();
stack_.clear();
keys_.clear();
}

void reset( basic_value< Traits >& v ) noexcept
{
value_.swap( v );
stack_.clear();
keys_.clear();
}

void null() noexcept
{
value_.set_null();
Expand Down

0 comments on commit 2f7ad8c

Please sign in to comment.