C++17 adds std::uninitialized_move
, but there is no std::uninitialized_move_if_noexcept
that would use std::move_if_noexcept
internally. In my opinion, it would be useful, since now, if we want to reallocate, we still need to write something as
if constexpr (!std::is_nothrow_move_constructible_v<value_type>
&& std::is_copy_constructible_v<value_type>)
std::uninitialized_copy(...);
else
std::uninitialized_move(...);
Are there any particular reasons why std::uninitialized_move_if_noexcept
was not introduced in C++17?