Browse Source

Using 'if constexpr'.

main
offa 7 years ago
parent
commit
5fee7b08a2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      include/unique_resource.h

+ 2
- 2
include/unique_resource.h View File

{ {
reset(); reset();


if( std::is_nothrow_move_assignable_v<R> == true )
if constexpr( std::is_nothrow_move_assignable_v<R> == true )
{ {
m_deleter.reset(detail::forward_if_nothrow_move_constructible(other.m_deleter.get())); m_deleter.reset(detail::forward_if_nothrow_move_constructible(other.m_deleter.get()));
m_resource.reset(std::forward<RR>(other.m_resource.get())); m_resource.reset(std::forward<RR>(other.m_resource.get()));
} }
else if( std::is_nothrow_move_assignable_v<D> == true )
else if constexpr( std::is_nothrow_move_assignable_v<D> == true )
{ {
m_resource.reset(detail::forward_if_nothrow_move_constructible(other.m_resource.get())); m_resource.reset(detail::forward_if_nothrow_move_constructible(other.m_resource.get()));
m_deleter.reset(std::forward<DD>(other.m_deleter.get())); m_deleter.reset(std::forward<DD>(other.m_deleter.get()));

Loading…
Cancel
Save