Skip to content

WIP: Move enum_ body to a non-templated class #1505

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

Closed
wants to merge 0 commits into from

Conversation

wjakob
Copy link
Member

@wjakob wjakob commented Aug 29, 2018

One of the inefficiencies that has been bothering me for a long time is that enum_ contains a huge amount of setup code that is replicated hundreds of times in larger codebases that make use of many enumerations. This patch reimplements enum_ in a compatible manner, with most code in a generic helper class.

The PR also adds a number of convenience functions (like operator+) from the number protocol to the detail::object_api class.

With this change, the example shared library binary size goes down by 103 KiB (3.2%). It is worth noting that the examples only contain 6 enums. In larger projects with many enum data structures, savings can be substantial.

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

Successfully merging this pull request may close these issues.

1 participant