better fields

This commit is contained in:
2025-02-06 18:30:35 +01:00
parent 8ecfb95167
commit a63395f219
3 changed files with 8 additions and 3 deletions

View File

@@ -71,10 +71,15 @@ struct FieldsBuilder<> {
using Type = std::tuple<>;
};
template<typename... TFields>
struct FieldsBuilder<std::tuple<TFields...>> {
using Type = typename FieldsBuilder<TFields...>::Type;
};
template <typename TField, typename... TFields>
struct FieldsBuilder<TField, TFields...> {
using Type = sp::tuple_cat_t<std::tuple<Field<TField>>, typename FieldsBuilder<TFields...>::Type>;
};
} // namespace sp

View File

@@ -54,7 +54,7 @@ struct MessageImplParsedOptions<option::DispatchImpl<TActual>, TOptions...> : pu
template <typename TFields, typename... TOptions>
struct MessageImplParsedOptions<option::FieldsImpl<TFields>, TOptions...> : public MessageImplParsedOptions<TOptions...> {
static const bool HasFieldsImpl = true;
using Fields = TFields;
using Fields = typename FieldsBuilder<TFields>::Type;
};