From be45a98e7f36d3bfd9b8513a1a462a5d3df47153 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Fri, 2 Feb 2024 07:43:51 +0700 Subject: [PATCH] fix little warnings --- ROADMAP.md | 1 + develop/singles/headers/meta.hpp/meta_all.hpp | 12 ++++++------ headers/meta.hpp/meta_binds.hpp | 4 ++-- headers/meta.hpp/meta_states.hpp | 2 +- headers/meta.hpp/meta_types.hpp | 2 +- headers/meta.hpp/meta_types/class_type.hpp | 2 +- headers/meta.hpp/meta_types/enum_type.hpp | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index e064456..1bf6a7a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,6 +5,7 @@ - type conversions - fix all includes to work with the library more flexible - test and support shared libraries +- remove ctor_type and dtor_type? ## Version 1.0 diff --git a/develop/singles/headers/meta.hpp/meta_all.hpp b/develop/singles/headers/meta.hpp/meta_all.hpp index 43883bf..ef80884 100644 --- a/develop/singles/headers/meta.hpp/meta_all.hpp +++ b/develop/singles/headers/meta.hpp/meta_all.hpp @@ -2508,7 +2508,7 @@ namespace meta_hpp type_base() = default; explicit type_base(data_ptr data) - : data_{data} {} + : data_{std::move(data)} {} type_base(type_base&&) noexcept = default; type_base(const type_base&) = default; @@ -3564,7 +3564,7 @@ namespace meta_hpp state_base() = default; explicit state_base(state_ptr state) - : state_{state} {} + : state_{std::move(state)} {} state_base(state_base&&) noexcept = default; state_base(const state_base&) = default; @@ -4729,12 +4729,12 @@ namespace meta_hpp namespace meta_hpp { inline scope_bind local_scope_(std::string name, metadata_map metadata = {}) { - scope local_scope{detail::scope_state::make(std::move(name), std::move(metadata))}; + const scope local_scope{detail::scope_state::make(std::move(name), std::move(metadata))}; return scope_bind{local_scope, {}}; } inline scope_bind static_scope_(std::string_view name, metadata_map metadata = {}) { - scope static_scope{resolve_scope(name)}; + const scope static_scope{resolve_scope(name)}; return scope_bind{static_scope, std::move(metadata)}; } @@ -8244,7 +8244,7 @@ namespace meta_hpp if ( const evalue& value = get_evalue(name) ) { return value.get_value(); } - static uvalue empty_value; + static const uvalue empty_value; return empty_value; } } @@ -8647,7 +8647,7 @@ namespace meta_hpp if ( position < data_->argument_values.size() ) { return data_->argument_values[position]; } - static uvalue empty_value; + static const uvalue empty_value; return empty_value; } diff --git a/headers/meta.hpp/meta_binds.hpp b/headers/meta.hpp/meta_binds.hpp index d5cac73..4154cdc 100644 --- a/headers/meta.hpp/meta_binds.hpp +++ b/headers/meta.hpp/meta_binds.hpp @@ -289,12 +289,12 @@ namespace meta_hpp namespace meta_hpp { inline scope_bind local_scope_(std::string name, metadata_map metadata = {}) { - scope local_scope{detail::scope_state::make(std::move(name), std::move(metadata))}; + const scope local_scope{detail::scope_state::make(std::move(name), std::move(metadata))}; return scope_bind{local_scope, {}}; } inline scope_bind static_scope_(std::string_view name, metadata_map metadata = {}) { - scope static_scope{resolve_scope(name)}; + const scope static_scope{resolve_scope(name)}; return scope_bind{static_scope, std::move(metadata)}; } diff --git a/headers/meta.hpp/meta_states.hpp b/headers/meta.hpp/meta_states.hpp index 2adac57..2e62854 100644 --- a/headers/meta.hpp/meta_states.hpp +++ b/headers/meta.hpp/meta_states.hpp @@ -155,7 +155,7 @@ namespace meta_hpp state_base() = default; explicit state_base(state_ptr state) - : state_{state} {} + : state_{std::move(state)} {} state_base(state_base&&) noexcept = default; state_base(const state_base&) = default; diff --git a/headers/meta.hpp/meta_types.hpp b/headers/meta.hpp/meta_types.hpp index 9e4d1a5..e399e0f 100644 --- a/headers/meta.hpp/meta_types.hpp +++ b/headers/meta.hpp/meta_types.hpp @@ -106,7 +106,7 @@ namespace meta_hpp type_base() = default; explicit type_base(data_ptr data) - : data_{data} {} + : data_{std::move(data)} {} type_base(type_base&&) noexcept = default; type_base(const type_base&) = default; diff --git a/headers/meta.hpp/meta_types/class_type.hpp b/headers/meta.hpp/meta_types/class_type.hpp index 5b69ddb..b35c98e 100644 --- a/headers/meta.hpp/meta_types/class_type.hpp +++ b/headers/meta.hpp/meta_types/class_type.hpp @@ -156,7 +156,7 @@ namespace meta_hpp if ( position < data_->argument_values.size() ) { return data_->argument_values[position]; } - static uvalue empty_value; + static const uvalue empty_value; return empty_value; } diff --git a/headers/meta.hpp/meta_types/enum_type.hpp b/headers/meta.hpp/meta_types/enum_type.hpp index 36bd36b..14dacbd 100644 --- a/headers/meta.hpp/meta_types/enum_type.hpp +++ b/headers/meta.hpp/meta_types/enum_type.hpp @@ -66,7 +66,7 @@ namespace meta_hpp if ( const evalue& value = get_evalue(name) ) { return value.get_value(); } - static uvalue empty_value; + static const uvalue empty_value; return empty_value; } }