noexcept_traits: convert enable_if to concepts
A little easier to read. Closes #8329
This commit is contained in:
@@ -39,11 +39,12 @@
|
||||
// T val2 = traits::unwrap(f.get0());
|
||||
//
|
||||
|
||||
template<typename T, typename Enable = void>
|
||||
template<typename T>
|
||||
struct noexcept_movable;
|
||||
|
||||
template<typename T>
|
||||
struct noexcept_movable<T, std::enable_if_t<std::is_nothrow_move_constructible<T>::value>> {
|
||||
requires std::is_nothrow_move_constructible_v<T>
|
||||
struct noexcept_movable<T> {
|
||||
using type = T;
|
||||
|
||||
static type wrap(T&& v) {
|
||||
@@ -64,7 +65,8 @@ struct noexcept_movable<T, std::enable_if_t<std::is_nothrow_move_constructible<T
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct noexcept_movable<T, std::enable_if_t<!std::is_nothrow_move_constructible<T>::value>> {
|
||||
requires (!std::is_nothrow_move_constructible_v<T>)
|
||||
struct noexcept_movable<T> {
|
||||
using type = std::unique_ptr<T>;
|
||||
|
||||
static type wrap(T&& v) {
|
||||
|
||||
Reference in New Issue
Block a user