From 963f06f27bcd3d8f06a9d8aeb169c653fc48b3cb Mon Sep 17 00:00:00 2001 From: Neil Henderson <2060747+bluetarpmedia@users.noreply.github.com> Date: Fri, 14 Jun 2024 03:31:25 +1000 Subject: [PATCH] Make `cpp2::move` `constexpr` (#1106) * cpp2::move is now constexpr * Add `inline` too --------- Co-authored-by: Herb Sutter --- include/cpp2util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cpp2util.h b/include/cpp2util.h index 971e7d4c4..d93913d38 100644 --- a/include/cpp2util.h +++ b/include/cpp2util.h @@ -485,13 +485,13 @@ concept valid_custom_is_operator = predicate_member_fun template requires (std::is_copy_constructible_v>) -auto move(T&& t) -> decltype(auto) { +inline constexpr auto move(T&& t) -> decltype(auto) { return std::move(t); } template requires (!std::is_copy_constructible_v>) -auto move(T&& t) -> decltype(auto) { +inline constexpr auto move(T&& t) -> decltype(auto) { return std::forward(t); }