Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Sep 21, 2023
1 parent 9d8d3fa commit 7d7622e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions include/ylt/struct_pack/reflection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@ template <typename T, typename = void>
if constexpr (std::is_same_v<T,std::monostate>) {
return true;
}
else if constexpr (std::is_abstract_v<T>) {
return false;
}
else if constexpr (is_compatible_v<T> || is_trivial_view_v<T>) {
return ignore_compatible_field;
}
Expand Down
9 changes: 3 additions & 6 deletions include/ylt/struct_pack/struct_pack_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -569,7 +569,7 @@ constexpr type_id get_type_id() {
}
else if constexpr (unique_ptr<T>) {
if constexpr (is_base_class<typename T::element_type>) {
return type_id::unique_derived_class_t;
return type_id::polymorphic_unique_ptr_t;
}
else {
return type_id::optional_t;
Expand All @@ -587,10 +587,7 @@ constexpr type_id get_type_id() {
else if constexpr (expected<T>) {
return type_id::expected_t;
}
else if constexpr (is_trivial_tuple<T> || pair<T>) {
return type_id::struct_t;
}
else if constexpr (std::is_class_v<T>) {
else if constexpr (is_trivial_tuple<T> || pair<T> || std::is_class_v<T>) {
return type_id::struct_t;
}
else {
Expand Down

0 comments on commit 7d7622e

Please sign in to comment.