The default
constructor of copyable-box<T> is equivalent to:
constexprcopyable-box()noexcept(is_nothrow_default_constructible_v<T>)requiresdefault_initializable<T>:copyable-box{in_place}{}
If copyable<T> is not
modeled, the copy assignment operator is equivalent to:
constexprcopyable-box&operator=(constcopyable-box& that)noexcept(is_nothrow_copy_constructible_v<T>){if(this!= addressof(that)){if(that) emplace(*that);
else reset();
}return*this;
}
If movable<T> is not modeled,
the move assignment operator is equivalent to:
constexprcopyable-box&operator=(copyable-box&& that)noexcept(is_nothrow_move_constructible_v<T>){if(this!= addressof(that)){if(that) emplace(std::move(*that));
else reset();
}return*this;
}
Recommended practice: copyable-box<T> should store only a T
if either T models copyable or
is_nothrow_move_constructible_v<T>&& is_nothrow_copy_constructible_v<T>
is true.