From 4d9274b80b980b90f99a1ca085f9339f001da16b Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Tue, 24 Oct 2023 22:34:36 +0200 Subject: [PATCH] Fix unveiling base ctor in dispatcher issue --- txml/applications/json/include/Deserializer.hpp | 2 +- txml/include/engine/fwd/DispatcherBase.h | 5 +++++ txml/include/engine/fwd/Helpers.h | 11 ++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/txml/applications/json/include/Deserializer.hpp b/txml/applications/json/include/Deserializer.hpp index c41fe0a..99af009 100644 --- a/txml/applications/json/include/Deserializer.hpp +++ b/txml/applications/json/include/Deserializer.hpp @@ -76,7 +76,7 @@ std::optional FromJSON::deserialize_tag_impl(c return {}; } - return std::make_optional((begin_it++).value().get()); + return std::make_optional((begin_it++).value().template get()); } template diff --git a/txml/include/engine/fwd/DispatcherBase.h b/txml/include/engine/fwd/DispatcherBase.h index 509e197..e8ae2f3 100644 --- a/txml/include/engine/fwd/DispatcherBase.h +++ b/txml/include/engine/fwd/DispatcherBase.h @@ -35,6 +35,11 @@ struct DispatcherVirtualBase : public Contexts... { } + VirtualBaseContext& get_virtual_base() + { + return *static_cast(this); + } + template typename std::add_pointer::type>::type dispatch_context(Tracer &tracer) { diff --git a/txml/include/engine/fwd/Helpers.h b/txml/include/engine/fwd/Helpers.h index 959e961..8471ab0 100644 --- a/txml/include/engine/fwd/Helpers.h +++ b/txml/include/engine/fwd/Helpers.h @@ -103,7 +103,7 @@ struct DispatchableClass : public BaseImpl < Class_Aggregator, __VA_ARGS__ > { \ using base_t = BaseImpl < Class_Aggregator, __VA_ARGS__ >; \ using virtual_base_t = typename base_t::core_t; \ - using base_t::BaseImpl; \ + using base_t::base_t; \ static constexpr const char *name() { return #DispatchableClass"<"#__VA_ARGS__">"; } \ static constexpr std::string_view enumerate() { return enumerate_impl<__VA_ARGS__>(); } \ template \ @@ -132,9 +132,10 @@ struct DispatchableClass : public BaseImpl < Class_Aggregator, __VA_ARGS__ > struct Class_Aggregator : \ public txml::SerializerSchemaDispatcher, __VA_ARGS__ > \ { \ - using base_t = \ - txml::SerializerSchemaDispatcher , __VA_ARGS__ >; \ using virtual_base_t = txml::utils::core_t_extractor_t<__VA_ARGS__>; \ + using base_t = \ + txml::SerializerSchemaDispatcher ; \ + \ static constexpr const char *name() { return #Class_Aggregator"<"#__VA_ARGS__">"; } \ \ Class_Aggregator(typename virtual_base_t::ctor_arg_t shared_arg = virtual_base_t::default_ctor_arg()) : \ @@ -157,7 +158,7 @@ struct DispatchableClass : public BaseImpl < Class_Aggregator, __VA_ARGS__ > { \ using base_t = BaseImpl < Class_Aggregator, __VA_ARGS__ >; \ using virtual_base_t = typename base_t::core_t; \ - using base_t::BaseImpl; \ + using base_t::base_t; \ static constexpr const char *name() { return #DispatchableClass"<"#__VA_ARGS__">"; } \ static constexpr std::string_view enumerate() { return enumerate_impl<__VA_ARGS__>(); } \ template \ @@ -214,7 +215,7 @@ struct DispatchableClass : public BaseImpl < Class_Aggregator, __VA_ARGS__ > { \ using base_t = BaseImpl < Class_Aggregator, __VA_ARGS__ >; \ using virtual_base_t = typename base_t::core_t; \ - using base_t::BaseImpl; \ + using base_t::base_t; \ static constexpr const char *name() { return #DispatchableClass":"#Class_Aggregator"<"#__VA_ARGS__">"; } \ static constexpr std::string_view enumerate() { return enumerate_impl<__VA_ARGS__>(); } \ template \