Skip to content

Commit

Permalink
Fixes issue #53: Removes static_assert in value::swap and just swaps …
Browse files Browse the repository at this point in the history
…the union.
  • Loading branch information
tgockel committed Jul 25, 2015
1 parent 0e2aafd commit 637e470
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/jsonv/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ void value::swap(value& other) noexcept
{
using std::swap;

// We swap the objects here because all types of the union a trivially swappable and swap needs to work on a type,
// not a union.
static_assert(sizeof _data == sizeof _data.object, "!!");
swap(_data.object, other._data.object);
// All types of this union a trivially swappable
swap(_data, other._data);
swap(_kind, other._kind);
}

Expand Down

0 comments on commit 637e470

Please sign in to comment.