Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated enum adapation #132

Open
andrewkcorcoran opened this issue Aug 11, 2021 · 1 comment
Open

Automated enum adapation #132

andrewkcorcoran opened this issue Aug 11, 2021 · 1 comment

Comments

@andrewkcorcoran
Copy link

Using something like https://github.com/Neargye/magic_enum it would be possible to auto adapt enums for the user without them having to manually list all the various enum values. Completely understandable if you don't want to take a dependency like this - but just a thought.

@erenon
Copy link
Contributor

erenon commented Aug 11, 2021

This looks promising indeed. (I wonder how fast it can be compiled) Binlog is desinged in a way that adaptions can be added without forcing a dependency on everyone, e.g: there's adapt_stdvariant.hpp, that can be included, if the user wants it. In a similar manner, we could have:

#include <binlog/adapt_magic_enum.hpp> // requires user installing magic_enum

enum Foo { a, b, c};
BINLOG_ADAPT_MAGIC_ENUM(Foo)

Alternatively, we could also have:

#include <binlog/auto_adapt_magic_enum_compatible_enums.hpp>

that adds a specialization for every enum type, that magic enum supports. I don't know yet if it is feasible.
(I have little time to clear the backlog, so it will take a long time probably)

@andrewkcorcoran andrewkcorcoran changed the title Automated enum adaptaion Automated enum adapation Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants