diff --git a/develop/singles/headers/meta.hpp/meta_all.hpp b/develop/singles/headers/meta.hpp/meta_all.hpp index 7261f1b..11c73fb 100644 --- a/develop/singles/headers/meta.hpp/meta_all.hpp +++ b/develop/singles/headers/meta.hpp/meta_all.hpp @@ -3392,6 +3392,121 @@ namespace std }; } +namespace meta_hpp +{ + namespace constructor_policy + { + inline constexpr struct as_object_t final { + } as_object{}; + + inline constexpr struct as_raw_pointer_t final { + } as_raw_pointer{}; + + inline constexpr struct as_shared_pointer_t final { + } as_shared_pointer{}; + + inline constexpr struct as_unique_pointer_t final { + } as_unique_pointer{}; + } + + namespace function_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct discard_return_t final { + } discard_return{}; + + inline constexpr struct return_reference_as_pointer_t final { + } return_reference_as_pointer{}; + } + + namespace member_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct as_pointer_t final { + } as_pointer{}; + + inline constexpr struct as_reference_wrapper_t final { + } as_reference_wrapper{}; + } + + namespace method_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct discard_return_t final { + } discard_return{}; + + inline constexpr struct return_reference_as_pointer_t final { + } return_reference_as_pointer{}; + } + + namespace variable_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct as_pointer_t final { + } as_pointer{}; + + inline constexpr struct as_reference_wrapper_t final { + } as_reference_wrapper{}; + } +} + +namespace meta_hpp::detail +{ + template < typename Policy > + concept constructor_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept function_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept member_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept method_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept variable_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename T > + using is_constructor_policy = std::bool_constant>; + + template < typename T > + using is_function_policy = std::bool_constant>; + + template < typename T > + using is_member_policy = std::bool_constant>; + + template < typename T > + using is_method_policy = std::bool_constant>; + + template < typename T > + using is_variable_policy = std::bool_constant>; +} + namespace meta_hpp { class uerror final { @@ -3605,134 +3720,6 @@ namespace meta_hpp::detail }; } -namespace meta_hpp -{ - namespace constructor_policy - { - inline constexpr struct as_object_t final { - } as_object{}; - - inline constexpr struct as_raw_pointer_t final { - } as_raw_pointer{}; - - inline constexpr struct as_shared_pointer_t final { - } as_shared_pointer{}; - - inline constexpr struct as_unique_pointer_t final { - } as_unique_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace function_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct discard_return_t final { - } discard_return{}; - - inline constexpr struct return_reference_as_pointer_t final { - } return_reference_as_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace member_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct as_pointer_t final { - } as_pointer{}; - - inline constexpr struct as_reference_wrapper_t final { - } as_reference_wrapper{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - - } - - namespace method_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct discard_return_t final { - } discard_return{}; - - inline constexpr struct return_reference_as_pointer_t final { - } return_reference_as_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace variable_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct as_pointer_t final { - } as_pointer{}; - - inline constexpr struct as_reference_wrapper_t final { - } as_reference_wrapper{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } -} - namespace meta_hpp { template < state_family State > @@ -4160,7 +4147,7 @@ namespace meta_hpp::detail create_error_impl create_error{}; argument_list arguments{}; - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > [[nodiscard]] static constructor_state_ptr make(metadata_map metadata); explicit constructor_state(constructor_index index, metadata_map metadata); }; @@ -4205,7 +4192,7 @@ namespace meta_hpp::detail invoke_error_impl invoke_error{}; argument_list arguments{}; - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > [[nodiscard]] static function_state_ptr make(std::string name, Function function_ptr, metadata_map metadata); explicit function_state(function_index index, metadata_map metadata); }; @@ -4225,7 +4212,7 @@ namespace meta_hpp::detail getter_error_impl getter_error{}; setter_error_impl setter_error{}; - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > [[nodiscard]] static member_state_ptr make(std::string name, Member member_ptr, metadata_map metadata); explicit member_state(member_index index, metadata_map metadata); }; @@ -4241,7 +4228,7 @@ namespace meta_hpp::detail invoke_error_impl invoke_error{}; argument_list arguments{}; - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > [[nodiscard]] static method_state_ptr make(std::string name, Method method_ptr, metadata_map metadata); explicit method_state(method_index index, metadata_map metadata); }; @@ -4270,7 +4257,7 @@ namespace meta_hpp::detail setter_impl setter{}; setter_error_impl setter_error{}; - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > [[nodiscard]] static variable_state_ptr make(std::string name, Pointer variable_ptr, metadata_map metadata); explicit variable_state(variable_index index, metadata_map metadata); }; @@ -5178,11 +5165,13 @@ namespace meta_hpp template < typename... Args, typename... Opts > requires detail::class_bind_constructor_kind class_bind& class_bind::constructor_(Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "constructor policy may be specified only once" ); @@ -5190,7 +5179,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::constructor_state::make(std::move(metadata)); + auto state = constructor_state::make(std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -5200,11 +5189,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().constructors, constructor{std::move(state)}); + insert_or_assign(get_data().constructors, constructor{std::move(state)}); return *this; } @@ -5212,20 +5201,23 @@ namespace meta_hpp template < typename... Opts > requires detail::class_bind_destructor_kind class_bind& class_bind::destructor_(Opts&&... opts) { + using namespace detail; metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::destructor_state::make(std::move(metadata)); - detail::insert_or_assign(get_data().destructors, destructor{std::move(state)}); + auto state = destructor_state::make(std::move(metadata)); + insert_or_assign(get_data().destructors, destructor{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::function_pointer_kind Function, typename... Opts > class_bind& class_bind::function_(std::string name, Function function_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "function policy may be specified only once" ); @@ -5233,7 +5225,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::function_state::make(std::move(name), function_ptr, std::move(metadata)); + auto state = function_state::make(std::move(name), function_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -5243,39 +5235,43 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().functions, function{std::move(state)}); + insert_or_assign(get_data().functions, function{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::class_bind_member_kind Member, typename... Opts > class_bind& class_bind::member_(std::string name, Member member_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "member policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::member_state::make(std::move(name), member_ptr, std::move(metadata)); - detail::insert_or_assign(get_data().members, member{std::move(state)}); + auto state = member_state::make(std::move(name), member_ptr, std::move(metadata)); + insert_or_assign(get_data().members, member{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::class_bind_method_kind Method, typename... Opts > class_bind& class_bind::method_(std::string name, Method method_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "method policy may be specified only once" ); @@ -5283,7 +5279,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::method_state::make(std::move(name), method_ptr, std::move(metadata)); + auto state = method_state::make(std::move(name), method_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -5293,11 +5289,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().methods, method{std::move(state)}); + insert_or_assign(get_data().methods, method{std::move(state)}); return *this; } @@ -5311,17 +5307,19 @@ namespace meta_hpp template < detail::class_kind Class > template < detail::pointer_kind Pointer, typename... Opts > class_bind& class_bind::variable_(std::string name, Pointer variable_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "variable policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::variable_state::make(std::move(name), variable_ptr, std::move(metadata)); - detail::insert_or_assign(get_data().variables, variable{std::move(state)}); + auto state = variable_state::make(std::move(name), variable_ptr, std::move(metadata)); + insert_or_assign(get_data().variables, variable{std::move(state)}); return *this; } } @@ -5398,11 +5396,13 @@ namespace meta_hpp template < detail::function_pointer_kind Function, typename... Opts > scope_bind& scope_bind::function_(std::string name, Function function_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "function policy may be specified only once" ); @@ -5410,7 +5410,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::function_state::make(std::move(name), function_ptr, std::move(metadata)); + auto state = function_state::make(std::move(name), function_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -5420,11 +5420,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_state().functions, function{std::move(state)}); + insert_or_assign(get_state().functions, function{std::move(state)}); return *this; } @@ -5436,17 +5436,19 @@ namespace meta_hpp template < detail::pointer_kind Pointer, typename... Opts > scope_bind& scope_bind::variable_(std::string name, Pointer variable_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "variable policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::variable_state::make(std::move(name), variable_ptr, std::move(metadata)); - detail::insert_or_assign(get_state().variables, variable{std::move(state)}); + auto state = variable_state::make(std::move(name), variable_ptr, std::move(metadata)); + insert_or_assign(get_state().variables, variable{std::move(state)}); return *this; } } @@ -6765,7 +6767,7 @@ namespace meta_hpp namespace meta_hpp::detail { - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > uvalue raw_function_invoke(type_registry& registry, Function function_ptr, std::span args) { using ft = function_traits>; using return_type = typename ft::return_type; @@ -6832,7 +6834,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > function_state::invoke_impl make_function_invoke(type_registry& registry, Function function_ptr) { return [®istry, function_ptr](std::span args) { // return raw_function_invoke(registry, function_ptr, args); @@ -6867,7 +6869,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > function_state_ptr function_state::make(std::string name, Function function_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; @@ -7267,7 +7269,7 @@ namespace meta_hpp namespace meta_hpp::detail { - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > uvalue raw_member_getter(type_registry& registry, Member member_ptr, const uinst& inst) { using mt = member_traits; using class_type = typename mt::class_type; @@ -7410,7 +7412,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > member_state::getter_impl make_member_getter(type_registry& registry, Member member_ptr) { return [®istry, member_ptr](const uinst& inst) { // return raw_member_getter(registry, member_ptr, inst); @@ -7445,7 +7447,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > member_state_ptr member_state::make(std::string name, Member member_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; @@ -7653,7 +7655,7 @@ namespace meta_hpp namespace meta_hpp::detail { - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > uvalue raw_method_invoke(type_registry& registry, Method method_ptr, const uinst& inst, std::span args) { using mt = method_traits; using return_type = typename mt::return_type; @@ -7731,7 +7733,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > method_state::invoke_impl make_method_invoke(type_registry& registry, Method method_ptr) { return [®istry, method_ptr](const uinst& inst, std::span args) { return raw_method_invoke(registry, method_ptr, inst, args); @@ -7766,7 +7768,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > method_state_ptr method_state::make(std::string name, Method method_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; @@ -8262,7 +8264,7 @@ namespace meta_hpp namespace meta_hpp::detail { - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > uvalue raw_constructor_create(type_registry& registry, std::span args) { using ct = constructor_traits; using class_type = typename ct::class_type; @@ -8351,7 +8353,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > constructor_state::create_impl make_constructor_create(type_registry& registry) { return [®istry](std::span args) { // return raw_constructor_create(registry, args); @@ -8393,7 +8395,7 @@ namespace meta_hpp::detail : index{nindex} , metadata{std::move(nmetadata)} {} - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > constructor_state_ptr constructor_state::make(metadata_map metadata) { type_registry& registry{type_registry::instance()}; @@ -8850,7 +8852,7 @@ namespace meta_hpp namespace meta_hpp::detail { - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > uvalue raw_variable_getter(type_registry&, Pointer variable_ptr) { using pt = pointer_traits; using data_type = typename pt::data_type; @@ -8922,7 +8924,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > variable_state::getter_impl make_variable_getter(type_registry& registry, Pointer variable_ptr) { return [®istry, variable_ptr]() { // return raw_variable_getter(registry, variable_ptr); @@ -8950,7 +8952,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > variable_state_ptr variable_state::make(std::string name, Pointer variable_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; diff --git a/develop/untests/meta_headers/policies_tests.cpp b/develop/untests/meta_headers/policies_tests.cpp new file mode 100644 index 0000000..a49463a --- /dev/null +++ b/develop/untests/meta_headers/policies_tests.cpp @@ -0,0 +1,16 @@ +/******************************************************************************* + * This file is part of the "https://github.com/blackmatov/meta.hpp" + * For conditions of distribution and use, see copyright notice in LICENSE.md + * Copyright (C) 2021-2024, by Matvey Cherevko (blackmatov@gmail.com) + ******************************************************************************/ + +#if defined(META_HPP_HEADERS_BUILD) +# include +#else +# include +#endif + +#include + +TEST_CASE("meta/meta_headers/policies") { +} diff --git a/headers/meta.hpp/meta_all.hpp b/headers/meta.hpp/meta_all.hpp index c07ca95..293ab94 100644 --- a/headers/meta.hpp/meta_all.hpp +++ b/headers/meta.hpp/meta_all.hpp @@ -36,6 +36,8 @@ #include "meta_invoke.hpp" #include "meta_invoke/invoke.hpp" +#include "meta_policies.hpp" + #include "meta_registry.hpp" #include "meta_states.hpp" diff --git a/headers/meta.hpp/meta_binds/class_bind.hpp b/headers/meta.hpp/meta_binds/class_bind.hpp index 28223f2..e5f66f3 100644 --- a/headers/meta.hpp/meta_binds/class_bind.hpp +++ b/headers/meta.hpp/meta_binds/class_bind.hpp @@ -24,11 +24,13 @@ namespace meta_hpp template < typename... Args, typename... Opts > requires detail::class_bind_constructor_kind class_bind& class_bind::constructor_(Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "constructor policy may be specified only once" ); @@ -36,7 +38,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::constructor_state::make(std::move(metadata)); + auto state = constructor_state::make(std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -46,11 +48,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().constructors, constructor{std::move(state)}); + insert_or_assign(get_data().constructors, constructor{std::move(state)}); return *this; } @@ -58,20 +60,23 @@ namespace meta_hpp template < typename... Opts > requires detail::class_bind_destructor_kind class_bind& class_bind::destructor_(Opts&&... opts) { + using namespace detail; metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::destructor_state::make(std::move(metadata)); - detail::insert_or_assign(get_data().destructors, destructor{std::move(state)}); + auto state = destructor_state::make(std::move(metadata)); + insert_or_assign(get_data().destructors, destructor{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::function_pointer_kind Function, typename... Opts > class_bind& class_bind::function_(std::string name, Function function_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "function policy may be specified only once" ); @@ -79,7 +84,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::function_state::make(std::move(name), function_ptr, std::move(metadata)); + auto state = function_state::make(std::move(name), function_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -89,39 +94,43 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().functions, function{std::move(state)}); + insert_or_assign(get_data().functions, function{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::class_bind_member_kind Member, typename... Opts > class_bind& class_bind::member_(std::string name, Member member_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "member policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::member_state::make(std::move(name), member_ptr, std::move(metadata)); - detail::insert_or_assign(get_data().members, member{std::move(state)}); + auto state = member_state::make(std::move(name), member_ptr, std::move(metadata)); + insert_or_assign(get_data().members, member{std::move(state)}); return *this; } template < detail::class_kind Class > template < detail::class_bind_method_kind Method, typename... Opts > class_bind& class_bind::method_(std::string name, Method method_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "method policy may be specified only once" ); @@ -129,7 +138,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::method_state::make(std::move(name), method_ptr, std::move(metadata)); + auto state = method_state::make(std::move(name), method_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -139,11 +148,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_data().methods, method{std::move(state)}); + insert_or_assign(get_data().methods, method{std::move(state)}); return *this; } @@ -157,17 +166,19 @@ namespace meta_hpp template < detail::class_kind Class > template < detail::pointer_kind Pointer, typename... Opts > class_bind& class_bind::variable_(std::string name, Pointer variable_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "variable policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::variable_state::make(std::move(name), variable_ptr, std::move(metadata)); - detail::insert_or_assign(get_data().variables, variable{std::move(state)}); + auto state = variable_state::make(std::move(name), variable_ptr, std::move(metadata)); + insert_or_assign(get_data().variables, variable{std::move(state)}); return *this; } } diff --git a/headers/meta.hpp/meta_binds/scope_bind.hpp b/headers/meta.hpp/meta_binds/scope_bind.hpp index cd0e27c..98dbfa9 100644 --- a/headers/meta.hpp/meta_binds/scope_bind.hpp +++ b/headers/meta.hpp/meta_binds/scope_bind.hpp @@ -17,11 +17,13 @@ namespace meta_hpp template < detail::function_pointer_kind Function, typename... Opts > scope_bind& scope_bind::function_(std::string name, Function function_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "function policy may be specified only once" ); @@ -29,7 +31,7 @@ namespace meta_hpp metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); arguments_bind::values_t arguments = arguments_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::function_state::make(std::move(name), function_ptr, std::move(metadata)); + auto state = function_state::make(std::move(name), function_ptr, std::move(metadata)); META_HPP_ASSERT( // arguments.size() <= state->arguments.size() // @@ -39,11 +41,11 @@ namespace meta_hpp using std::min; // prevents windows.h min/max issues for ( std::size_t i{}, e{min(arguments.size(), state->arguments.size())}; i < e; ++i ) { argument& arg = state->arguments[i]; - detail::state_access(arg)->name = std::move(arguments[i].get_name()); - detail::state_access(arg)->metadata = std::move(arguments[i].get_metadata()); + state_access(arg)->name = std::move(arguments[i].get_name()); + state_access(arg)->metadata = std::move(arguments[i].get_metadata()); } - detail::insert_or_assign(get_state().functions, function{std::move(state)}); + insert_or_assign(get_state().functions, function{std::move(state)}); return *this; } @@ -55,17 +57,19 @@ namespace meta_hpp template < detail::pointer_kind Pointer, typename... Opts > scope_bind& scope_bind::variable_(std::string name, Pointer variable_ptr, Opts&&... opts) { - using opts_t = detail::type_list...>; - using policy_t = detail::type_list_first_of_t; + using namespace detail; + + using opts_t = type_list...>; + using policy_t = type_list_first_of_t; static_assert( // - detail::type_list_count_of_v <= 1, + type_list_count_of_v <= 1, "variable policy may be specified only once" ); metadata_bind::values_t metadata = metadata_bind::from_opts(META_HPP_FWD(opts)...); - auto state = detail::variable_state::make(std::move(name), variable_ptr, std::move(metadata)); - detail::insert_or_assign(get_state().variables, variable{std::move(state)}); + auto state = variable_state::make(std::move(name), variable_ptr, std::move(metadata)); + insert_or_assign(get_state().variables, variable{std::move(state)}); return *this; } } diff --git a/headers/meta.hpp/meta_policies.hpp b/headers/meta.hpp/meta_policies.hpp new file mode 100644 index 0000000..caabdda --- /dev/null +++ b/headers/meta.hpp/meta_policies.hpp @@ -0,0 +1,124 @@ +/******************************************************************************* + * This file is part of the "https://github.com/blackmatov/meta.hpp" + * For conditions of distribution and use, see copyright notice in LICENSE.md + * Copyright (C) 2021-2024, by Matvey Cherevko (blackmatov@gmail.com) + ******************************************************************************/ + +#pragma once + +#include "meta_base.hpp" + +namespace meta_hpp +{ + namespace constructor_policy + { + inline constexpr struct as_object_t final { + } as_object{}; + + inline constexpr struct as_raw_pointer_t final { + } as_raw_pointer{}; + + inline constexpr struct as_shared_pointer_t final { + } as_shared_pointer{}; + + inline constexpr struct as_unique_pointer_t final { + } as_unique_pointer{}; + } + + namespace function_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct discard_return_t final { + } discard_return{}; + + inline constexpr struct return_reference_as_pointer_t final { + } return_reference_as_pointer{}; + } + + namespace member_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct as_pointer_t final { + } as_pointer{}; + + inline constexpr struct as_reference_wrapper_t final { + } as_reference_wrapper{}; + } + + namespace method_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct discard_return_t final { + } discard_return{}; + + inline constexpr struct return_reference_as_pointer_t final { + } return_reference_as_pointer{}; + } + + namespace variable_policy + { + inline constexpr struct as_copy_t final { + } as_copy{}; + + inline constexpr struct as_pointer_t final { + } as_pointer{}; + + inline constexpr struct as_reference_wrapper_t final { + } as_reference_wrapper{}; + } +} + +namespace meta_hpp::detail +{ + template < typename Policy > + concept constructor_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept function_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept member_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept method_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename Policy > + concept variable_policy_family // + = std::is_same_v // + || std::is_same_v // + || std::is_same_v; // + + template < typename T > + using is_constructor_policy = std::bool_constant>; + + template < typename T > + using is_function_policy = std::bool_constant>; + + template < typename T > + using is_member_policy = std::bool_constant>; + + template < typename T > + using is_method_policy = std::bool_constant>; + + template < typename T > + using is_variable_policy = std::bool_constant>; +} diff --git a/headers/meta.hpp/meta_states.hpp b/headers/meta.hpp/meta_states.hpp index 5449ad6..6f8a900 100644 --- a/headers/meta.hpp/meta_states.hpp +++ b/headers/meta.hpp/meta_states.hpp @@ -8,140 +8,13 @@ #include "meta_base.hpp" #include "meta_indices.hpp" +#include "meta_policies.hpp" #include "meta_types.hpp" #include "meta_uresult.hpp" #include "meta_uvalue.hpp" #include "meta_detail/state_family.hpp" -namespace meta_hpp -{ - namespace constructor_policy - { - inline constexpr struct as_object_t final { - } as_object{}; - - inline constexpr struct as_raw_pointer_t final { - } as_raw_pointer{}; - - inline constexpr struct as_shared_pointer_t final { - } as_shared_pointer{}; - - inline constexpr struct as_unique_pointer_t final { - } as_unique_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace function_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct discard_return_t final { - } discard_return{}; - - inline constexpr struct return_reference_as_pointer_t final { - } return_reference_as_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace member_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct as_pointer_t final { - } as_pointer{}; - - inline constexpr struct as_reference_wrapper_t final { - } as_reference_wrapper{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - - } - - namespace method_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct discard_return_t final { - } discard_return{}; - - inline constexpr struct return_reference_as_pointer_t final { - } return_reference_as_pointer{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } - - namespace variable_policy - { - inline constexpr struct as_copy_t final { - } as_copy{}; - - inline constexpr struct as_pointer_t final { - } as_pointer{}; - - inline constexpr struct as_reference_wrapper_t final { - } as_reference_wrapper{}; - - template < typename Policy > - concept family // - = std::is_same_v // - || std::is_same_v // - || std::is_same_v; // - - template < typename T > - using is_family = std::bool_constant>; - - template < typename T > - inline constexpr bool is_family_v = is_family::value; - } -} - namespace meta_hpp { template < state_family State > @@ -569,7 +442,7 @@ namespace meta_hpp::detail create_error_impl create_error{}; argument_list arguments{}; - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > [[nodiscard]] static constructor_state_ptr make(metadata_map metadata); explicit constructor_state(constructor_index index, metadata_map metadata); }; @@ -614,7 +487,7 @@ namespace meta_hpp::detail invoke_error_impl invoke_error{}; argument_list arguments{}; - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > [[nodiscard]] static function_state_ptr make(std::string name, Function function_ptr, metadata_map metadata); explicit function_state(function_index index, metadata_map metadata); }; @@ -634,7 +507,7 @@ namespace meta_hpp::detail getter_error_impl getter_error{}; setter_error_impl setter_error{}; - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > [[nodiscard]] static member_state_ptr make(std::string name, Member member_ptr, metadata_map metadata); explicit member_state(member_index index, metadata_map metadata); }; @@ -650,7 +523,7 @@ namespace meta_hpp::detail invoke_error_impl invoke_error{}; argument_list arguments{}; - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > [[nodiscard]] static method_state_ptr make(std::string name, Method method_ptr, metadata_map metadata); explicit method_state(method_index index, metadata_map metadata); }; @@ -679,7 +552,7 @@ namespace meta_hpp::detail setter_impl setter{}; setter_error_impl setter_error{}; - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > [[nodiscard]] static variable_state_ptr make(std::string name, Pointer variable_ptr, metadata_map metadata); explicit variable_state(variable_index index, metadata_map metadata); }; diff --git a/headers/meta.hpp/meta_states/constructor.hpp b/headers/meta.hpp/meta_states/constructor.hpp index ee344df..88152a2 100644 --- a/headers/meta.hpp/meta_states/constructor.hpp +++ b/headers/meta.hpp/meta_states/constructor.hpp @@ -15,7 +15,7 @@ namespace meta_hpp::detail { - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > uvalue raw_constructor_create(type_registry& registry, std::span args) { using ct = constructor_traits; using class_type = typename ct::class_type; @@ -104,7 +104,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > constructor_state::create_impl make_constructor_create(type_registry& registry) { return [®istry](std::span args) { // return raw_constructor_create(registry, args); @@ -146,7 +146,7 @@ namespace meta_hpp::detail : index{nindex} , metadata{std::move(nmetadata)} {} - template < constructor_policy::family Policy, class_kind Class, typename... Args > + template < constructor_policy_family Policy, class_kind Class, typename... Args > constructor_state_ptr constructor_state::make(metadata_map metadata) { type_registry& registry{type_registry::instance()}; diff --git a/headers/meta.hpp/meta_states/function.hpp b/headers/meta.hpp/meta_states/function.hpp index 49dc105..49842c2 100644 --- a/headers/meta.hpp/meta_states/function.hpp +++ b/headers/meta.hpp/meta_states/function.hpp @@ -15,7 +15,7 @@ namespace meta_hpp::detail { - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > uvalue raw_function_invoke(type_registry& registry, Function function_ptr, std::span args) { using ft = function_traits>; using return_type = typename ft::return_type; @@ -82,7 +82,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > function_state::invoke_impl make_function_invoke(type_registry& registry, Function function_ptr) { return [®istry, function_ptr](std::span args) { // return raw_function_invoke(registry, function_ptr, args); @@ -117,7 +117,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < function_policy::family Policy, function_pointer_kind Function > + template < function_policy_family Policy, function_pointer_kind Function > function_state_ptr function_state::make(std::string name, Function function_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; diff --git a/headers/meta.hpp/meta_states/member.hpp b/headers/meta.hpp/meta_states/member.hpp index ab8a080..fb9b29d 100644 --- a/headers/meta.hpp/meta_states/member.hpp +++ b/headers/meta.hpp/meta_states/member.hpp @@ -16,7 +16,7 @@ namespace meta_hpp::detail { - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > uvalue raw_member_getter(type_registry& registry, Member member_ptr, const uinst& inst) { using mt = member_traits; using class_type = typename mt::class_type; @@ -159,7 +159,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > member_state::getter_impl make_member_getter(type_registry& registry, Member member_ptr) { return [®istry, member_ptr](const uinst& inst) { // return raw_member_getter(registry, member_ptr, inst); @@ -194,7 +194,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < member_policy::family Policy, member_pointer_kind Member > + template < member_policy_family Policy, member_pointer_kind Member > member_state_ptr member_state::make(std::string name, Member member_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; diff --git a/headers/meta.hpp/meta_states/method.hpp b/headers/meta.hpp/meta_states/method.hpp index df8e1b2..0f860a4 100644 --- a/headers/meta.hpp/meta_states/method.hpp +++ b/headers/meta.hpp/meta_states/method.hpp @@ -16,7 +16,7 @@ namespace meta_hpp::detail { - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > uvalue raw_method_invoke(type_registry& registry, Method method_ptr, const uinst& inst, std::span args) { using mt = method_traits; using return_type = typename mt::return_type; @@ -94,7 +94,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > method_state::invoke_impl make_method_invoke(type_registry& registry, Method method_ptr) { return [®istry, method_ptr](const uinst& inst, std::span args) { return raw_method_invoke(registry, method_ptr, inst, args); @@ -129,7 +129,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < method_policy::family Policy, method_pointer_kind Method > + template < method_policy_family Policy, method_pointer_kind Method > method_state_ptr method_state::make(std::string name, Method method_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()}; diff --git a/headers/meta.hpp/meta_states/variable.hpp b/headers/meta.hpp/meta_states/variable.hpp index 18975b8..215312f 100644 --- a/headers/meta.hpp/meta_states/variable.hpp +++ b/headers/meta.hpp/meta_states/variable.hpp @@ -15,7 +15,7 @@ namespace meta_hpp::detail { - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > uvalue raw_variable_getter(type_registry&, Pointer variable_ptr) { using pt = pointer_traits; using data_type = typename pt::data_type; @@ -87,7 +87,7 @@ namespace meta_hpp::detail namespace meta_hpp::detail { - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > variable_state::getter_impl make_variable_getter(type_registry& registry, Pointer variable_ptr) { return [®istry, variable_ptr]() { // return raw_variable_getter(registry, variable_ptr); @@ -115,7 +115,7 @@ namespace meta_hpp::detail : index{std::move(nindex)} , metadata{std::move(nmetadata)} {} - template < variable_policy::family Policy, pointer_kind Pointer > + template < variable_policy_family Policy, pointer_kind Pointer > variable_state_ptr variable_state::make(std::string name, Pointer variable_ptr, metadata_map metadata) { type_registry& registry{type_registry::instance()};