From f97cd9492eae237a2ecc2565dda9520068175cfa Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Wed, 7 Jul 2021 03:27:28 +0700 Subject: [PATCH] fix msvc warnings --- headers/meta.hpp/meta_field.hpp | 4 ++-- headers/meta.hpp/meta_field_info.hpp | 6 +++--- headers/meta.hpp/meta_function.hpp | 4 ++-- headers/meta.hpp/meta_function_info.hpp | 4 ++-- headers/meta.hpp/meta_method.hpp | 4 ++-- headers/meta.hpp/meta_method_info.hpp | 6 +++--- headers/meta.hpp/meta_variable.hpp | 6 ++++-- headers/meta.hpp/meta_variable_info.hpp | 6 +++--- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/headers/meta.hpp/meta_field.hpp b/headers/meta.hpp/meta_field.hpp index dce9fad..ceb758e 100644 --- a/headers/meta.hpp/meta_field.hpp +++ b/headers/meta.hpp/meta_field.hpp @@ -19,8 +19,8 @@ namespace meta_hpp public: static_assert(std::is_member_object_pointer_v); - explicit field_(std::string id, FieldType field) - : info_{std::move(id), field} {} + explicit field_(std::string id, FieldType field_ptr) + : info_{std::move(id), field_ptr} {} operator const field_info&() const noexcept { return info_; diff --git a/headers/meta.hpp/meta_field_info.hpp b/headers/meta.hpp/meta_field_info.hpp index 80068e7..08eff3c 100644 --- a/headers/meta.hpp/meta_field_info.hpp +++ b/headers/meta.hpp/meta_field_info.hpp @@ -128,10 +128,10 @@ namespace meta_hpp friend class field_; template < typename FieldType > - field_info(std::string id, FieldType field) + field_info(std::string id, FieldType field_ptr) : id_{std::move(id)} - , getter_{field_detail::make_getter(field)} - , setter_{field_detail::make_setter(field)} {} + , getter_{field_detail::make_getter(field_ptr)} + , setter_{field_detail::make_setter(field_ptr)} {} private: std::string id_; field_detail::field_getter getter_; diff --git a/headers/meta.hpp/meta_function.hpp b/headers/meta.hpp/meta_function.hpp index 75aa470..6fb5d41 100644 --- a/headers/meta.hpp/meta_function.hpp +++ b/headers/meta.hpp/meta_function.hpp @@ -19,8 +19,8 @@ namespace meta_hpp public: static_assert(std::is_function_v>); - explicit function_(std::string id, FunctionType function) - : info_{std::move(id), function} {} + explicit function_(std::string id, FunctionType function_ptr) + : info_{std::move(id), function_ptr} {} operator const function_info&() const noexcept { return info_; diff --git a/headers/meta.hpp/meta_function_info.hpp b/headers/meta.hpp/meta_function_info.hpp index a0be8cc..d5333fc 100644 --- a/headers/meta.hpp/meta_function_info.hpp +++ b/headers/meta.hpp/meta_function_info.hpp @@ -117,9 +117,9 @@ namespace meta_hpp friend class function_; template < typename FunctionType > - function_info(std::string id, FunctionType function) + function_info(std::string id, FunctionType function_ptr) : id_{std::move(id)} - , invoke_{function_detail::make_invoke(function)} {} + , invoke_{function_detail::make_invoke(function_ptr)} {} private: std::string id_; function_detail::function_invoke invoke_; diff --git a/headers/meta.hpp/meta_method.hpp b/headers/meta.hpp/meta_method.hpp index ccdd9d8..a89393d 100644 --- a/headers/meta.hpp/meta_method.hpp +++ b/headers/meta.hpp/meta_method.hpp @@ -19,8 +19,8 @@ namespace meta_hpp public: static_assert(std::is_member_function_pointer_v); - explicit method_(std::string id, MethodType method) - : info_{std::move(id), method} {} + explicit method_(std::string id, MethodType method_ptr) + : info_{std::move(id), method_ptr} {} operator const method_info&() const { return info_; diff --git a/headers/meta.hpp/meta_method_info.hpp b/headers/meta.hpp/meta_method_info.hpp index 4d9d5ce..d5ea0d2 100644 --- a/headers/meta.hpp/meta_method_info.hpp +++ b/headers/meta.hpp/meta_method_info.hpp @@ -196,10 +196,10 @@ namespace meta_hpp friend class method_; template < typename MethodType > - method_info(std::string id, MethodType method) + method_info(std::string id, MethodType method_ptr) : id_{std::move(id)} - , invoke_{method_detail::make_invoke(method)} - , cinvoke_{method_detail::make_cinvoke(method)} {} + , invoke_{method_detail::make_invoke(method_ptr)} + , cinvoke_{method_detail::make_cinvoke(method_ptr)} {} private: std::string id_; method_detail::method_invoke invoke_; diff --git a/headers/meta.hpp/meta_variable.hpp b/headers/meta.hpp/meta_variable.hpp index 09e3498..33059eb 100644 --- a/headers/meta.hpp/meta_variable.hpp +++ b/headers/meta.hpp/meta_variable.hpp @@ -17,8 +17,10 @@ namespace meta_hpp template < typename VariableType > class variable_ { public: - explicit variable_(std::string id, VariableType variable) - : info_{std::move(id), variable} {} + static_assert(std::is_pointer_v); + + explicit variable_(std::string id, VariableType variable_ptr) + : info_{std::move(id), variable_ptr} {} operator const variable_info&() const noexcept { return info_; diff --git a/headers/meta.hpp/meta_variable_info.hpp b/headers/meta.hpp/meta_variable_info.hpp index 789bb5f..b1a2506 100644 --- a/headers/meta.hpp/meta_variable_info.hpp +++ b/headers/meta.hpp/meta_variable_info.hpp @@ -113,10 +113,10 @@ namespace meta_hpp friend class variable_; template < typename VariableType > - variable_info(std::string id, VariableType variable) + variable_info(std::string id, VariableType variable_ptr) : id_{std::move(id)} - , getter_{variable_detail::make_getter(variable)} - , setter_{variable_detail::make_setter(variable)} {} + , getter_{variable_detail::make_getter(variable_ptr)} + , setter_{variable_detail::make_setter(variable_ptr)} {} private: std::string id_; variable_detail::variable_getter getter_;