offa 7 anni fa
parent
commit
8cd44f63f0
1 ha cambiato i file con 2 aggiunte e 7 eliminazioni
  1. +2
    -7
      include/unique_resource.h

+ 2
- 7
include/unique_resource.h Vedi File

@@ -46,17 +46,12 @@ namespace sr
}


template<class T, std::enable_if_t<std::is_nothrow_move_constructible<T>::value, int> = 0>
constexpr T&& forward_if_nothrow_move_constructible(T&& value)
template<class T, class U = std::conditional_t<std::is_nothrow_move_constructible<T>::value, T&&, const T&>>
constexpr U forward_if_nothrow_move_constructible(T&& value)
{
return std::forward<T>(value);
}

template<class T, std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0>
constexpr const T& forward_if_nothrow_move_constructible(T&& value)
{
return value;
}


template<class R, class D>

Loading…
Annulla
Salva