Skip to content

Commit

Permalink
update code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Aug 16, 2016
1 parent 8dee588 commit cfc81e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/strict_variant/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,10 @@ auto
variant<First, Types...>::emplace(Args &&... args) noexcept(false)
-> mpl::enable_if_t<!std::is_nothrow_constructible<typename storage_t::template value_t<idx>,
Args...>::value> {

using temp_t = typename storage_t::template value_t<idx>;
static_assert(
std::is_nothrow_move_constructible<temp_t>::value,
"To use emplace, either the invoked ctor or the move ctor of value type must be noexcept.");
// TODO: If T is in a recursive_wrapper, we should construct recursive_wrapper<T> instead.
temp_t temp(std::forward<Args>(args)...);
this->emplace<idx>(std::move(temp));
}
Expand Down Expand Up @@ -679,6 +677,7 @@ struct variant<First, Types...>::swapper {
void do_swap() const noexcept { lhs_.apply_visitor_internal(*this); }

// First visit is *this, to lhs_var
// Second visit is to rhs_var
template <typename T>
void operator()(T & first_visit) const noexcept {
second_visitor<T> v{lhs_, rhs_, first_visit};
Expand Down

0 comments on commit cfc81e7

Please sign in to comment.