33//
44#pragma once
55
6+ #include < compare>
67#include < concepts>
78#include < type_traits>
8- #include < utility>
99
1010#include " ../macros.h"
1111
@@ -288,14 +288,13 @@ namespace stdsharp
288288 template <typename T>
289289 concept nothrow_move_assignable = ::std::is_nothrow_move_assignable_v<T>;
290290
291- template <typename T>
292- concept nothrow_swappable =
293- requires (T& t1, T& t2) { requires noexcept (::std::ranges::swap (t1, t2)); };
294-
295291 template <typename T, typename U>
296292 concept nothrow_swappable_with =
297293 requires (T& t, U& u) { requires noexcept (::std::ranges::swap (t, u)); };
298294
295+ template <typename T>
296+ concept nothrow_swappable = nothrow_swappable_with<T, T>;
297+
299298 template <typename T>
300299 concept nothrow_movable = ::std::movable<T> && //
301300 nothrow_move_constructible<T> &&
@@ -320,11 +319,11 @@ namespace stdsharp
320319 concept nothrow_convertible_to = ::std::is_nothrow_convertible_v<T, U>;
321320
322321 template <typename From, typename To>
323- concept explicitly_convertible = requires { static_cast <To>(std::declval<From>( )); };
322+ concept explicitly_convertible = requires (From&& v) { static_cast <To>(cpp_forward (v )); };
324323
325324 template <typename From, typename To>
326325 concept nothrow_explicitly_convertible =
327- requires { requires noexcept (static_cast <To>(std::declval<From>( ))); };
326+ requires (From&& v) { requires noexcept (static_cast <To>(cpp_forward (v ))); };
328327
329328 template <typename To, typename From>
330329 concept explicitly_convertible_from = explicitly_convertible<From, To>;
0 commit comments