From 4c4b5ce3dcd84ad7f67593aa5c2b788f8f2d4307 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 4 Nov 2023 21:29:26 +0400 Subject: [PATCH] fix --- include/anyany/anyany.hpp | 34 +++++++--------------------------- tests/test_anyany.cpp | 2 +- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/include/anyany/anyany.hpp b/include/anyany/anyany.hpp index 5bb9415..4f4ad50 100644 --- a/include/anyany/anyany.hpp +++ b/include/anyany/anyany.hpp @@ -1172,35 +1172,15 @@ struct basic_any : construct_interface, Metho using base_any_type = basic_any; using methods_list = ::aa::type_list; - private: - template - struct types { - using ptr = poly_ptr; - using const_ptr = const_poly_ptr; - using ref = poly_ref; - using const_ref = const_poly_ref; - using stateful_ref = stateful::ref; - using stateful_cref = stateful::cref; - using interface = runtime_concept; - }; - // remove 'destroy' Method only if it was automatically added(not provided by user/created by 'materialize') - template - struct remove_utility_methods : types {}; - template - struct remove_utility_methods : types {}; - - using purified = remove_utility_methods; - - public: - using ptr = typename purified::ptr; - using ref = typename purified::ref; - using cptr = typename purified::const_ptr; - using cref = typename purified::const_ref; + using ptr = poly_ptr; + using ref = poly_ref; + using cptr = const_poly_ptr; + using cref = const_poly_ref; using const_ptr = cptr; using const_ref = cref; - using stateful_ref = typename purified::stateful_ref; - using stateful_cref = typename purified::stateful_cref; - using interface = typename purified::interface; + using stateful_ref = stateful::ref; + using stateful_cref = stateful::cref; + using interface = runtime_concept; // aliases without 'destroy' for usage like any_with::ref // but operator& return with 'destroy' method(implicitly converitble anyway) diff --git a/tests/test_anyany.cpp b/tests/test_anyany.cpp index 084c2bb..4b82e05 100644 --- a/tests/test_anyany.cpp +++ b/tests/test_anyany.cpp @@ -981,7 +981,7 @@ void anyany_interface_alias_tests() { aa::basic_any>); static_assert(std::is_same_v::ref, - aa::poly_ref>); + aa::poly_ref>); #if __cplusplus >= 202002L static_assert(aa::compound_method); static_assert(aa::compound_method);