diff --git a/develop/singles/headers/meta.hpp/meta_all.hpp b/develop/singles/headers/meta.hpp/meta_all.hpp index 8110722..f6b5858 100644 --- a/develop/singles/headers/meta.hpp/meta_all.hpp +++ b/develop/singles/headers/meta.hpp/meta_all.hpp @@ -5969,18 +5969,27 @@ namespace meta_hpp::detail requires std::is_same_v explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast(v.get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v.get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < typename T, typename Tp = std::decay_t > requires std::is_same_v explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast(v->get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v->get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < typename T, non_uvalue_family Tp = std::decay_t > explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast*>(std::addressof(v))} {} // NOLINT(*-const-cast) + , data_{const_cast*>(std::addressof(v))} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < non_function_pointer_kind To > [[nodiscard]] decltype(auto) cast(type_registry& registry) const; @@ -6408,6 +6417,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->invoke_error(vargs) ) { return err; @@ -6558,18 +6568,27 @@ namespace meta_hpp::detail requires std::is_same_v explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast(v.get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v.get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < typename T, typename Tp = std::decay_t > requires std::is_same_v explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast(v->get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v->get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < typename T, non_uvalue_family Tp = std::decay_t > explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast*>(std::addressof(v))} {} // NOLINT(*-const-cast) + , data_{const_cast*>(std::addressof(v))} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < inst_class_ref_kind Q > [[nodiscard]] decltype(auto) cast(type_registry& registry) const; @@ -6930,6 +6949,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; if ( const uerror err = state_->getter_error(vinst) ) { return err; @@ -6960,6 +6980,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const uarg_base vvalue{registry, META_HPP_FWD(value)}; if ( const uerror err = state_->setter_error(vinst, vvalue) ) { @@ -7228,6 +7249,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->invoke_error(vinst, vargs) ) { @@ -7308,6 +7330,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = raw_function_invoke_error(registry, vargs) ) { return err; @@ -7345,6 +7368,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; if ( const uerror err = raw_member_getter_error(registry, vinst) ) { return err; @@ -7383,6 +7407,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = raw_method_invoke_error(registry, vinst, vargs) ) { @@ -7777,6 +7802,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->create_error(vargs) ) { return err; @@ -7801,6 +7827,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->create_error(vargs) ) { return err; @@ -7967,6 +7994,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'arg', just checks conversion errors const uarg_base varg{registry, META_HPP_FWD(arg)}; if ( const uerror err = state_->destroy_error(varg) ) { return err; @@ -8286,6 +8314,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move a 'value', just checks conversion errors const uarg_base vvalue{registry, META_HPP_FWD(value)}; if ( const uerror err = state_->setter_error(vvalue) ) { return err; @@ -8469,8 +8498,8 @@ namespace meta_hpp uvalue class_type::create(Args&&... args) const { for ( const constructor& ctor : data_->constructors ) { if ( ctor.is_invocable_with(META_HPP_FWD(args)...) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move 'args' return ctor.create(META_HPP_FWD(args)...); } } @@ -8481,8 +8510,8 @@ namespace meta_hpp uvalue class_type::create_at(void* mem, Args&&... args) const { for ( const constructor& ctor : data_->constructors ) { if ( ctor.is_invocable_with(META_HPP_FWD(args)...) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move 'args' return ctor.create_at(mem, META_HPP_FWD(args)...); } } @@ -8493,8 +8522,8 @@ namespace meta_hpp bool class_type::destroy(Arg&& arg) const { if ( const destructor& dtor = get_destructor() ) { if ( dtor.is_invocable_with(META_HPP_FWD(arg)) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move an 'arg' dtor.destroy(META_HPP_FWD(arg)); return true; } diff --git a/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp b/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp index 36f531a..73ec2ba 100644 --- a/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp +++ b/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp @@ -112,18 +112,27 @@ namespace meta_hpp::detail requires std::is_same_v explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast(v.get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v.get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < typename T, typename Tp = std::decay_t > requires std::is_same_v explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast(v->get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v->get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < typename T, non_uvalue_family Tp = std::decay_t > explicit uarg(type_registry& registry, T&& v) : uarg_base{registry, std::forward(v)} - , data_{const_cast*>(std::addressof(v))} {} // NOLINT(*-const-cast) + , data_{const_cast*>(std::addressof(v))} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uarg_base' doesn't actually move 'v', just gets its type + } template < non_function_pointer_kind To > [[nodiscard]] decltype(auto) cast(type_registry& registry) const; diff --git a/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp b/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp index 493e6c6..4a47d9d 100644 --- a/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp +++ b/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp @@ -113,18 +113,27 @@ namespace meta_hpp::detail requires std::is_same_v explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast(v.get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v.get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < typename T, typename Tp = std::decay_t > requires std::is_same_v explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast(v->get_data())} {} // NOLINT(*-const-cast) + , data_{const_cast(v->get_data())} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < typename T, non_uvalue_family Tp = std::decay_t > explicit uinst(type_registry& registry, T&& v) : uinst_base{registry, std::forward(v)} - , data_{const_cast*>(std::addressof(v))} {} // NOLINT(*-const-cast) + , data_{const_cast*>(std::addressof(v))} { // NOLINT(*-const-cast) + // there is no 'use after move' here because + // 'uinst_base' doesn't actually move 'v', just gets its type + } template < inst_class_ref_kind Q > [[nodiscard]] decltype(auto) cast(type_registry& registry) const; diff --git a/headers/meta.hpp/meta_invoke/invoke.hpp b/headers/meta.hpp/meta_invoke/invoke.hpp index 511494c..b892d99 100644 --- a/headers/meta.hpp/meta_invoke/invoke.hpp +++ b/headers/meta.hpp/meta_invoke/invoke.hpp @@ -43,6 +43,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = raw_function_invoke_error(registry, vargs) ) { return err; @@ -80,6 +81,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; if ( const uerror err = raw_member_getter_error(registry, vinst) ) { return err; @@ -118,6 +120,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = raw_method_invoke_error(registry, vinst, vargs) ) { diff --git a/headers/meta.hpp/meta_states/constructor.hpp b/headers/meta.hpp/meta_states/constructor.hpp index ff6f980..a6aa398 100644 --- a/headers/meta.hpp/meta_states/constructor.hpp +++ b/headers/meta.hpp/meta_states/constructor.hpp @@ -178,6 +178,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->create_error(vargs) ) { return err; @@ -202,6 +203,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->create_error(vargs) ) { return err; diff --git a/headers/meta.hpp/meta_states/destructor.hpp b/headers/meta.hpp/meta_states/destructor.hpp index bde9758..320781c 100644 --- a/headers/meta.hpp/meta_states/destructor.hpp +++ b/headers/meta.hpp/meta_states/destructor.hpp @@ -114,6 +114,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'arg', just checks conversion errors const uarg_base varg{registry, META_HPP_FWD(arg)}; if ( const uerror err = state_->destroy_error(varg) ) { return err; diff --git a/headers/meta.hpp/meta_states/function.hpp b/headers/meta.hpp/meta_states/function.hpp index 837e03b..6237b74 100644 --- a/headers/meta.hpp/meta_states/function.hpp +++ b/headers/meta.hpp/meta_states/function.hpp @@ -158,6 +158,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move 'args', just checks conversion errors const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->invoke_error(vargs) ) { return err; diff --git a/headers/meta.hpp/meta_states/member.hpp b/headers/meta.hpp/meta_states/member.hpp index ba44cb5..b9cc45d 100644 --- a/headers/meta.hpp/meta_states/member.hpp +++ b/headers/meta.hpp/meta_states/member.hpp @@ -236,6 +236,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; if ( const uerror err = state_->getter_error(vinst) ) { return err; @@ -266,6 +267,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const uarg_base vvalue{registry, META_HPP_FWD(value)}; if ( const uerror err = state_->setter_error(vinst, vvalue) ) { diff --git a/headers/meta.hpp/meta_states/method.hpp b/headers/meta.hpp/meta_states/method.hpp index e8424ea..2ea6c17 100644 --- a/headers/meta.hpp/meta_states/method.hpp +++ b/headers/meta.hpp/meta_states/method.hpp @@ -171,6 +171,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move an 'instance' and 'args', just checks conversion errors const uinst_base vinst{registry, META_HPP_FWD(instance)}; const std::array vargs{uarg_base{registry, META_HPP_FWD(args)}...}; if ( const uerror err = state_->invoke_error(vinst, vargs) ) { diff --git a/headers/meta.hpp/meta_states/variable.hpp b/headers/meta.hpp/meta_states/variable.hpp index c2fb7ea..822d914 100644 --- a/headers/meta.hpp/meta_states/variable.hpp +++ b/headers/meta.hpp/meta_states/variable.hpp @@ -168,6 +168,7 @@ namespace meta_hpp type_registry& registry{type_registry::instance()}; { + // doesn't actually move a 'value', just checks conversion errors const uarg_base vvalue{registry, META_HPP_FWD(value)}; if ( const uerror err = state_->setter_error(vvalue) ) { return err; diff --git a/headers/meta.hpp/meta_types/class_type.hpp b/headers/meta.hpp/meta_types/class_type.hpp index 5c07627..0363700 100644 --- a/headers/meta.hpp/meta_types/class_type.hpp +++ b/headers/meta.hpp/meta_types/class_type.hpp @@ -158,8 +158,8 @@ namespace meta_hpp uvalue class_type::create(Args&&... args) const { for ( const constructor& ctor : data_->constructors ) { if ( ctor.is_invocable_with(META_HPP_FWD(args)...) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move 'args' return ctor.create(META_HPP_FWD(args)...); } } @@ -170,8 +170,8 @@ namespace meta_hpp uvalue class_type::create_at(void* mem, Args&&... args) const { for ( const constructor& ctor : data_->constructors ) { if ( ctor.is_invocable_with(META_HPP_FWD(args)...) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move 'args' return ctor.create_at(mem, META_HPP_FWD(args)...); } } @@ -182,8 +182,8 @@ namespace meta_hpp bool class_type::destroy(Arg&& arg) const { if ( const destructor& dtor = get_destructor() ) { if ( dtor.is_invocable_with(META_HPP_FWD(arg)) ) { - // There is no 'use after move' here because - // 'is_invocable_with' doesn't actually move its arguments + // there is no 'use after move' here because + // 'is_invocable_with' doesn't actually move an 'arg' dtor.destroy(META_HPP_FWD(arg)); return true; }