From c1badc63177aed82a10ba0cf589024d7b4df1161 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 21 Mar 2021 19:07:30 +0200 Subject: [PATCH] noexcept_traits: convert enable_if to concepts A little easier to read. Closes #8329 --- noexcept_traits.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/noexcept_traits.hh b/noexcept_traits.hh index 7888356ef6..d72bce7408 100644 --- a/noexcept_traits.hh +++ b/noexcept_traits.hh @@ -39,11 +39,12 @@ // T val2 = traits::unwrap(f.get0()); // -template +template struct noexcept_movable; template -struct noexcept_movable::value>> { +requires std::is_nothrow_move_constructible_v +struct noexcept_movable { using type = T; static type wrap(T&& v) { @@ -64,7 +65,8 @@ struct noexcept_movable -struct noexcept_movable::value>> { +requires (!std::is_nothrow_move_constructible_v) +struct noexcept_movable { using type = std::unique_ptr; static type wrap(T&& v) {