From da3d0fc5248e681532d0bbccbbc830df5bcdfcc8 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 13 Nov 2022 07:33:26 +0700 Subject: [PATCH] some new typedefs --- headers/meta.hpp/meta_base.hpp | 2 + headers/meta.hpp/meta_binds.hpp | 8 ++-- headers/meta.hpp/meta_registry.hpp | 4 +- headers/meta.hpp/meta_states/scope.hpp | 2 +- headers/meta.hpp/meta_types.hpp | 16 +++---- headers/meta.hpp/meta_types/class_type.hpp | 8 ++-- .../meta.hpp/meta_types/constructor_type.hpp | 2 +- headers/meta.hpp/meta_types/function_type.hpp | 2 +- headers/meta.hpp/meta_types/method_type.hpp | 2 +- singles/headers/meta.hpp/meta_all.hpp | 46 ++++++++++--------- untests/meta_states/scope_tests.cpp | 14 +++--- untests/meta_types/class_type_tests.cpp | 32 ++++++------- untests/meta_types/function_type_tests.cpp | 14 +++--- untests/meta_types/method_type_tests.cpp | 4 +- 14 files changed, 82 insertions(+), 74 deletions(-) diff --git a/headers/meta.hpp/meta_base.hpp b/headers/meta.hpp/meta_base.hpp index ad3b9d5..fc0b902 100644 --- a/headers/meta.hpp/meta_base.hpp +++ b/headers/meta.hpp/meta_base.hpp @@ -188,7 +188,9 @@ namespace meta_hpp namespace meta_hpp { + using any_type_list = std::vector; using argument_list = std::vector; + using metadata_map = std::map>; using typedef_map = std::map>; diff --git a/headers/meta.hpp/meta_binds.hpp b/headers/meta.hpp/meta_binds.hpp index 04a2143..84bae19 100644 --- a/headers/meta.hpp/meta_binds.hpp +++ b/headers/meta.hpp/meta_binds.hpp @@ -47,8 +47,10 @@ namespace meta_hpp metadata_map metadata{}; }; + using argument_opts_list = std::vector; + struct constructor_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; @@ -61,7 +63,7 @@ namespace meta_hpp }; struct function_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; @@ -70,7 +72,7 @@ namespace meta_hpp }; struct method_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; diff --git a/headers/meta.hpp/meta_registry.hpp b/headers/meta.hpp/meta_registry.hpp index 615936b..0675f71 100644 --- a/headers/meta.hpp/meta_registry.hpp +++ b/headers/meta.hpp/meta_registry.hpp @@ -23,7 +23,7 @@ namespace meta_hpp } template < typename... Ts > - [[nodiscard]] std::vector resolve_types() { + [[nodiscard]] any_type_list resolve_types() { return { resolve_type()... }; } } @@ -36,7 +36,7 @@ namespace meta_hpp } template < typename... Ts > - [[nodiscard]] std::vector resolve_types(type_list) { + [[nodiscard]] any_type_list resolve_types(type_list) { return { resolve_type()... }; } } diff --git a/headers/meta.hpp/meta_states/scope.hpp b/headers/meta.hpp/meta_states/scope.hpp index f969bb9..5bd4316 100644 --- a/headers/meta.hpp/meta_states/scope.hpp +++ b/headers/meta.hpp/meta_states/scope.hpp @@ -108,7 +108,7 @@ namespace meta_hpp continue; } - const std::vector& args = function.get_type().get_argument_types(); + const any_type_list& args = function.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return function; } diff --git a/headers/meta.hpp/meta_types.hpp b/headers/meta.hpp/meta_types.hpp index fe6b30a..187be35 100644 --- a/headers/meta.hpp/meta_types.hpp +++ b/headers/meta.hpp/meta_types.hpp @@ -154,7 +154,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; [[nodiscard]] const class_set& get_bases() const noexcept; [[nodiscard]] const constructor_map& get_constructors() const noexcept; @@ -228,7 +228,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_class_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::constructor_type_data* data_{}; friend auto detail::type_access(const constructor_type&); @@ -293,7 +293,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_return_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::function_type_data* data_{}; friend auto detail::type_access(const function_type&); @@ -334,7 +334,7 @@ namespace meta_hpp [[nodiscard]] class_type get_owner_type() const noexcept; [[nodiscard]] any_type get_return_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::method_type_data* data_{}; friend auto detail::type_access(const method_type&); @@ -496,7 +496,7 @@ namespace meta_hpp::detail const class_bitflags flags; const std::size_t size; const std::size_t align; - const std::vector argument_types; + const any_type_list argument_types; class_set bases; constructor_map constructors; @@ -522,7 +522,7 @@ namespace meta_hpp::detail struct constructor_type_data final : type_data_base { const constructor_bitflags flags; const any_type class_type; - const std::vector argument_types; + const any_type_list argument_types; template < class_kind Class, typename... Args > explicit constructor_type_data(type_list, type_list); @@ -549,7 +549,7 @@ namespace meta_hpp::detail struct function_type_data final : type_data_base { const function_bitflags flags; const any_type return_type; - const std::vector argument_types; + const any_type_list argument_types; template < function_kind Function > explicit function_type_data(type_list); @@ -568,7 +568,7 @@ namespace meta_hpp::detail const method_bitflags flags; const class_type owner_type; const any_type return_type; - const std::vector argument_types; + const any_type_list argument_types; template < method_kind Method > explicit method_type_data(type_list); diff --git a/headers/meta.hpp/meta_types/class_type.hpp b/headers/meta.hpp/meta_types/class_type.hpp index 68d27e6..d626f6d 100644 --- a/headers/meta.hpp/meta_types/class_type.hpp +++ b/headers/meta.hpp/meta_types/class_type.hpp @@ -73,7 +73,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& class_type::get_argument_types() const noexcept { + inline const any_type_list& class_type::get_argument_types() const noexcept { return data_->argument_types; } @@ -275,7 +275,7 @@ namespace meta_hpp template < typename Iter > constructor class_type::get_constructor_with(Iter first, Iter last) const noexcept { for ( auto&& [index, ctor] : data_->constructors ) { - const std::vector& args = ctor.get_type().get_argument_types(); + const any_type_list& args = ctor.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return ctor; } @@ -307,7 +307,7 @@ namespace meta_hpp continue; } - const std::vector& args = function.get_type().get_argument_types(); + const any_type_list& args = function.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return function; } @@ -346,7 +346,7 @@ namespace meta_hpp continue; } - const std::vector& args = method.get_type().get_argument_types(); + const any_type_list& args = method.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return method; } diff --git a/headers/meta.hpp/meta_types/constructor_type.hpp b/headers/meta.hpp/meta_types/constructor_type.hpp index 185801a..e0702c3 100644 --- a/headers/meta.hpp/meta_types/constructor_type.hpp +++ b/headers/meta.hpp/meta_types/constructor_type.hpp @@ -62,7 +62,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& constructor_type::get_argument_types() const noexcept { + inline const any_type_list& constructor_type::get_argument_types() const noexcept { return data_->argument_types; } } diff --git a/headers/meta.hpp/meta_types/function_type.hpp b/headers/meta.hpp/meta_types/function_type.hpp index 4dd6eee..f5fb1dc 100644 --- a/headers/meta.hpp/meta_types/function_type.hpp +++ b/headers/meta.hpp/meta_types/function_type.hpp @@ -62,7 +62,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& function_type::get_argument_types() const noexcept { + inline const any_type_list& function_type::get_argument_types() const noexcept { return data_->argument_types; } } diff --git a/headers/meta.hpp/meta_types/method_type.hpp b/headers/meta.hpp/meta_types/method_type.hpp index 1304827..83bc97d 100644 --- a/headers/meta.hpp/meta_types/method_type.hpp +++ b/headers/meta.hpp/meta_types/method_type.hpp @@ -67,7 +67,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& method_type::get_argument_types() const noexcept { + inline const any_type_list& method_type::get_argument_types() const noexcept { return data_->argument_types; } } diff --git a/singles/headers/meta.hpp/meta_all.hpp b/singles/headers/meta.hpp/meta_all.hpp index ae718b2..def2dc6 100644 --- a/singles/headers/meta.hpp/meta_all.hpp +++ b/singles/headers/meta.hpp/meta_all.hpp @@ -881,7 +881,9 @@ namespace meta_hpp namespace meta_hpp { + using any_type_list = std::vector; using argument_list = std::vector; + using metadata_map = std::map>; using typedef_map = std::map>; @@ -1562,7 +1564,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; [[nodiscard]] const class_set& get_bases() const noexcept; [[nodiscard]] const constructor_map& get_constructors() const noexcept; @@ -1636,7 +1638,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_class_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::constructor_type_data* data_{}; friend auto detail::type_access(const constructor_type&); @@ -1701,7 +1703,7 @@ namespace meta_hpp [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_return_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::function_type_data* data_{}; friend auto detail::type_access(const function_type&); @@ -1742,7 +1744,7 @@ namespace meta_hpp [[nodiscard]] class_type get_owner_type() const noexcept; [[nodiscard]] any_type get_return_type() const noexcept; [[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept; - [[nodiscard]] const std::vector& get_argument_types() const noexcept; + [[nodiscard]] const any_type_list& get_argument_types() const noexcept; private: detail::method_type_data* data_{}; friend auto detail::type_access(const method_type&); @@ -1904,7 +1906,7 @@ namespace meta_hpp::detail const class_bitflags flags; const std::size_t size; const std::size_t align; - const std::vector argument_types; + const any_type_list argument_types; class_set bases; constructor_map constructors; @@ -1930,7 +1932,7 @@ namespace meta_hpp::detail struct constructor_type_data final : type_data_base { const constructor_bitflags flags; const any_type class_type; - const std::vector argument_types; + const any_type_list argument_types; template < class_kind Class, typename... Args > explicit constructor_type_data(type_list, type_list); @@ -1957,7 +1959,7 @@ namespace meta_hpp::detail struct function_type_data final : type_data_base { const function_bitflags flags; const any_type return_type; - const std::vector argument_types; + const any_type_list argument_types; template < function_kind Function > explicit function_type_data(type_list); @@ -1976,7 +1978,7 @@ namespace meta_hpp::detail const method_bitflags flags; const class_type owner_type; const any_type return_type; - const std::vector argument_types; + const any_type_list argument_types; template < method_kind Method > explicit method_type_data(type_list); @@ -3161,8 +3163,10 @@ namespace meta_hpp metadata_map metadata{}; }; + using argument_opts_list = std::vector; + struct constructor_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; @@ -3175,7 +3179,7 @@ namespace meta_hpp }; struct function_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; @@ -3184,7 +3188,7 @@ namespace meta_hpp }; struct method_opts final { - std::vector arguments{}; + argument_opts_list arguments{}; metadata_map metadata{}; }; @@ -3601,7 +3605,7 @@ namespace meta_hpp } template < typename... Ts > - [[nodiscard]] std::vector resolve_types() { + [[nodiscard]] any_type_list resolve_types() { return { resolve_type()... }; } } @@ -3614,7 +3618,7 @@ namespace meta_hpp } template < typename... Ts > - [[nodiscard]] std::vector resolve_types(type_list) { + [[nodiscard]] any_type_list resolve_types(type_list) { return { resolve_type()... }; } } @@ -4623,7 +4627,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& constructor_type::get_argument_types() const noexcept { + inline const any_type_list& constructor_type::get_argument_types() const noexcept { return data_->argument_types; } } @@ -5640,7 +5644,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& function_type::get_argument_types() const noexcept { + inline const any_type_list& function_type::get_argument_types() const noexcept { return data_->argument_types; } } @@ -6374,7 +6378,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& method_type::get_argument_types() const noexcept { + inline const any_type_list& method_type::get_argument_types() const noexcept { return data_->argument_types; } } @@ -6847,7 +6851,7 @@ namespace meta_hpp return position < data_->argument_types.size() ? data_->argument_types[position] : any_type{}; } - inline const std::vector& class_type::get_argument_types() const noexcept { + inline const any_type_list& class_type::get_argument_types() const noexcept { return data_->argument_types; } @@ -7049,7 +7053,7 @@ namespace meta_hpp template < typename Iter > constructor class_type::get_constructor_with(Iter first, Iter last) const noexcept { for ( auto&& [index, ctor] : data_->constructors ) { - const std::vector& args = ctor.get_type().get_argument_types(); + const any_type_list& args = ctor.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return ctor; } @@ -7081,7 +7085,7 @@ namespace meta_hpp continue; } - const std::vector& args = function.get_type().get_argument_types(); + const any_type_list& args = function.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return function; } @@ -7120,7 +7124,7 @@ namespace meta_hpp continue; } - const std::vector& args = method.get_type().get_argument_types(); + const any_type_list& args = method.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return method; } @@ -7235,7 +7239,7 @@ namespace meta_hpp continue; } - const std::vector& args = function.get_type().get_argument_types(); + const any_type_list& args = function.get_type().get_argument_types(); if ( std::equal(first, last, args.begin(), args.end()) ) { return function; } diff --git a/untests/meta_states/scope_tests.cpp b/untests/meta_states/scope_tests.cpp index f8a756f..6dd81f2 100644 --- a/untests/meta_states/scope_tests.cpp +++ b/untests/meta_states/scope_tests.cpp @@ -178,17 +178,17 @@ TEST_CASE("meta/meta_states/scope") { meta::number_type double_type = meta::resolve_type(); CHECK_FALSE(math_scope.get_function_with<>("function_overloaded")); - CHECK(math_scope.get_function_with("function_overloaded", std::vector{int_type})); - CHECK_FALSE(math_scope.get_function_with("function_overloaded", std::vector{int_type, float_type})); + CHECK(math_scope.get_function_with("function_overloaded", meta::any_type_list{int_type})); + CHECK_FALSE(math_scope.get_function_with("function_overloaded", meta::any_type_list{int_type, float_type})); CHECK_FALSE(math_scope.get_function_with("function_overloaded")); - CHECK_FALSE(math_scope.get_function_with("function_overloaded", std::vector{float_type})); - CHECK(math_scope.get_function_with("function_overloaded", std::vector{int_type, int_type})); - CHECK_FALSE(math_scope.get_function_with("function_overloaded", std::vector{float_type, float_type})); + CHECK_FALSE(math_scope.get_function_with("function_overloaded", meta::any_type_list{float_type})); + CHECK(math_scope.get_function_with("function_overloaded", meta::any_type_list{int_type, int_type})); + CHECK_FALSE(math_scope.get_function_with("function_overloaded", meta::any_type_list{float_type, float_type})); CHECK_FALSE(math_scope.get_function_with<>("function_overloaded")); - CHECK_FALSE(math_scope.get_function_with("function_overloaded", std::vector{double_type})); - CHECK_FALSE(math_scope.get_function_with("function_overloaded", std::vector{double_type, double_type})); + CHECK_FALSE(math_scope.get_function_with("function_overloaded", meta::any_type_list{double_type})); + CHECK_FALSE(math_scope.get_function_with("function_overloaded", meta::any_type_list{double_type, double_type})); } } diff --git a/untests/meta_types/class_type_tests.cpp b/untests/meta_types/class_type_tests.cpp index 614f359..329daa4 100644 --- a/untests/meta_types/class_type_tests.cpp +++ b/untests/meta_types/class_type_tests.cpp @@ -176,17 +176,17 @@ TEST_CASE("meta/meta_types/class_type") { { const meta::class_type type = meta::resolve_type(); REQUIRE(type); - CHECK(type.get_argument_types() == std::vector{}); + CHECK(type.get_argument_types() == meta::any_type_list{}); } { const meta::class_type type = meta::resolve_type>(); REQUIRE(type); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); } { const meta::class_type type = meta::resolve_type>(); REQUIRE(type); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type(), meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type(), meta::resolve_type()}); } } @@ -438,17 +438,17 @@ TEST_CASE("meta/meta_types/class_type") { meta::number_type double_type = meta::resolve_type(); CHECK_FALSE(base_clazz_1_type.get_function_with<>("base_function_1_overloaded")); - CHECK(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{int_type})); - CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{int_type, float_type})); + CHECK(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{int_type})); + CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{int_type, float_type})); CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded")); - CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{float_type})); - CHECK(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{int_type, int_type})); - CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{float_type, float_type})); + CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{float_type})); + CHECK(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{int_type, int_type})); + CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{float_type, float_type})); CHECK_FALSE(base_clazz_1_type.get_function_with<>("base_function_1_overloaded")); - CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{double_type})); - CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", std::vector{double_type, double_type})); + CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{double_type})); + CHECK_FALSE(base_clazz_1_type.get_function_with("base_function_1_overloaded", meta::any_type_list{double_type, double_type})); } } @@ -493,16 +493,16 @@ TEST_CASE("meta/meta_types/class_type") { meta::number_type double_type = meta::resolve_type(); CHECK_FALSE(base_clazz_1_type.get_method_with<>("base_method_1_overloaded")); - CHECK(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{int_type})); - CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{int_type, int_type})); + CHECK(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{int_type})); + CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{int_type, int_type})); CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded")); - CHECK(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{float_type})); - CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{float_type, float_type})); + CHECK(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{float_type})); + CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{float_type, float_type})); CHECK_FALSE(base_clazz_1_type.get_method_with<>("base_method_1_overloaded")); - CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{double_type})); - CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", std::vector{double_type, double_type})); + CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{double_type})); + CHECK_FALSE(base_clazz_1_type.get_method_with("base_method_1_overloaded", meta::any_type_list{double_type, double_type})); } } } diff --git a/untests/meta_types/function_type_tests.cpp b/untests/meta_types/function_type_tests.cpp index e453eac..250e156 100644 --- a/untests/meta_types/function_type_tests.cpp +++ b/untests/meta_types/function_type_tests.cpp @@ -41,7 +41,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_arity() == 1); CHECK(type.get_return_type() == meta::resolve_type()); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -53,7 +53,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_ref_noexcept).get_id()); CHECK(type.get_flags() == meta::function_flags::is_noexcept); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -65,7 +65,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_cref_noexcept).get_id()); CHECK(type.get_flags() == meta::function_flags::is_noexcept); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -77,7 +77,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_bounded_arr).get_id()); CHECK(type.get_flags() == meta::function_flags{}); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -89,7 +89,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_unbounded_arr).get_id()); CHECK(type.get_flags() == meta::function_flags{}); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -101,7 +101,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_bounded_const_arr).get_id()); CHECK(type.get_flags() == meta::function_flags{}); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -113,7 +113,7 @@ TEST_CASE("meta/meta_types/function_type") { CHECK(type.get_id() == meta::resolve_type(&arg_unbounded_const_arr).get_id()); CHECK(type.get_flags() == meta::function_flags{}); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); diff --git a/untests/meta_types/method_type_tests.cpp b/untests/meta_types/method_type_tests.cpp index 181e87a..4175db8 100644 --- a/untests/meta_types/method_type_tests.cpp +++ b/untests/meta_types/method_type_tests.cpp @@ -45,7 +45,7 @@ TEST_CASE("meta/meta_types/method_type") { CHECK(type.get_arity() == 1); CHECK(type.get_owner_type() == meta::resolve_type()); CHECK(type.get_return_type() == meta::resolve_type()); - CHECK(type.get_argument_types() == std::vector{meta::resolve_type()}); + CHECK(type.get_argument_types() == meta::any_type_list{meta::resolve_type()}); CHECK(type.get_argument_type(0) == meta::resolve_type()); CHECK_FALSE(type.get_argument_type(1)); @@ -61,7 +61,7 @@ TEST_CASE("meta/meta_types/method_type") { CHECK(type.get_arity() == 0); CHECK(type.get_owner_type() == meta::resolve_type()); CHECK(type.get_return_type() == meta::resolve_type()); - CHECK(type.get_argument_types() == std::vector{}); + CHECK(type.get_argument_types() == meta::any_type_list{}); CHECK_FALSE(type.get_argument_type(0)); }