From 0ba240509f04d11d6f87b813aa591262f1a8a47b Mon Sep 17 00:00:00 2001 From: "Zezheng.Li" Date: Tue, 1 Aug 2023 18:33:52 +0800 Subject: [PATCH] fix --- include/ylt/struct_pack/struct_pack_impl.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/ylt/struct_pack/struct_pack_impl.hpp b/include/ylt/struct_pack/struct_pack_impl.hpp index e91a3f8828..e0285a54f5 100644 --- a/include/ylt/struct_pack/struct_pack_impl.hpp +++ b/include/ylt/struct_pack/struct_pack_impl.hpp @@ -928,8 +928,11 @@ constexpr decltype(auto) get_type_literal() { else { constexpr auto id = get_type_id(); constexpr auto ret = string_literal{{static_cast(id)}}; - if constexpr (id == type_id::non_trivial_class_t || - id == type_id::trivial_class_t) { + if constexpr (id == type_id::monostate_t) { + return ret; + } + else if constexpr (id == type_id::non_trivial_class_t || + id == type_id::trivial_class_t) { using Args = decltype(get_types()); constexpr auto body = get_type_literal( std::make_index_sequence>());