From 9ee8f6b00e487689211306af5b402db051d2cef3 Mon Sep 17 00:00:00 2001 From: Dan Weatherill Date: Tue, 4 Jun 2019 03:45:47 +0100 Subject: [PATCH] remove pessimizing moves on return remove several statements containing "return std::move(x)" which, according to the c++ standard 12.8/31 is pessimizing, because these objects are eligible for the NRVO. This issues a warning in gcc 9 otherwise. --- src/rttr/detail/registration/bind_impl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rttr/detail/registration/bind_impl.h b/src/rttr/detail/registration/bind_impl.h index 7bb63278..606398a4 100644 --- a/src/rttr/detail/registration/bind_impl.h +++ b/src/rttr/detail/registration/bind_impl.h @@ -295,7 +295,7 @@ class registration::bind(args)...)), std::move(get_default_args, function_type>(std::forward(args)...)), std::move(create_param_infos, function_type>(std::forward(args)...))); - return std::move(ctor); + return ctor; } public: bind(const std::shared_ptr& reg_exec, F func) @@ -397,7 +397,7 @@ class registration::bind : getter_policy, setter_policy, Metadata_Count, Visitor_List>>(name, acc, std::move(metadata_list)); - return std::move(prop); + return prop; } public: @@ -491,7 +491,7 @@ class registration::bind >(name, getter, setter, std::move(metadata_list)); - return std::move(prop); + return prop; } public: @@ -583,7 +583,7 @@ class registration::bind >(name, acc, std::move(metadata_list)); - return std::move(prop); + return prop; } public: @@ -678,7 +678,7 @@ class registration::bind : std::move(get_metadata(std::forward(args)...)), std::move(get_default_args, function_type>(std::forward(args)...)), std::move(create_param_infos, function_type>(std::forward(args)...)) ); - return std::move(meth); + return meth; } template @@ -791,7 +791,7 @@ class registration::bind : public registra std::move(get_metadata(std::forward(args)...))); - return std::move(enum_wrapper); + return enum_wrapper; } public: