diff --git a/include/ylt/struct_pack/reflection.hpp b/include/ylt/struct_pack/reflection.hpp index 339c5ec2c..b2c1465e2 100644 --- a/include/ylt/struct_pack/reflection.hpp +++ b/include/ylt/struct_pack/reflection.hpp @@ -728,6 +728,9 @@ template if constexpr (std::is_same_v) { return true; } + else if constexpr (std::is_abstract_v) { + return false; + } else if constexpr (is_compatible_v || is_trivial_view_v) { return ignore_compatible_field; } diff --git a/include/ylt/struct_pack/struct_pack_impl.hpp b/include/ylt/struct_pack/struct_pack_impl.hpp index 7e06765c9..1f310c34d 100644 --- a/include/ylt/struct_pack/struct_pack_impl.hpp +++ b/include/ylt/struct_pack/struct_pack_impl.hpp @@ -340,7 +340,7 @@ enum class type_id { variant_t, expected_t, bitset_t, - unique_derived_class_t, + polymorphic_unique_ptr_t, // monostate, or void monostate_t = 250, // circle_flag @@ -569,7 +569,7 @@ constexpr type_id get_type_id() { } else if constexpr (unique_ptr) { if constexpr (is_base_class) { - return type_id::unique_derived_class_t; + return type_id::polymorphic_unique_ptr_t; } else { return type_id::optional_t; @@ -587,10 +587,7 @@ constexpr type_id get_type_id() { else if constexpr (expected) { return type_id::expected_t; } - else if constexpr (is_trivial_tuple || pair) { - return type_id::struct_t; - } - else if constexpr (std::is_class_v) { + else if constexpr (is_trivial_tuple || pair || std::is_class_v) { return type_id::struct_t; } else {