OleksandrKvl / sbepp

C++ implementation of the FIX Simple Binary Encoding
https://oleksandrkvl.github.io/sbepp/
MIT License
39 stars 4 forks source link

Support `visit()` for sets and enums #45

Closed OleksandrKvl closed 3 months ago

OleksandrKvl commented 3 months ago

Initially, these were considered as over complication so only enum_to_string and visit_set were provided with limited functionality. Taking #38 into account, it makes sense to support fully-fledged visitation. It seems natural to introduce new visit() callbacks like

template<typename ChoiceTag>
void on_set_choice(bool value, ChoiceTag);

template<typename Enum, typename EnumValueTag>
void on_enum_value(Enum value, EnumValueTag);

With this being implemented, enum_to_string and visit_set should be deprecated.