-
Notifications
You must be signed in to change notification settings - Fork 20
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
Extend requirement system to optional properties #107
Comments
One option could be to have a list of |
There is one solution to check at compile-time if an enum is defined or not using SFINAE. By going further, we can define another macro We could also rely on this mechanism to ensure at compile time that only one class fits a primitive, in replacement to the current dynamic version that use On the other hand, the less flexible solution with the list of all capabilities has its advantages : less unsafe macros, and a global view of what capabilities exist. |
@ThibaultLejemble I like the idea to use SFINAE. I think we could have a macro to declare and collect the capabilities, that could help for the documentation generation for instance. |
Right now the provide/requirement system is based on enum check, which fail if
Base::PROVIDE_SOMETHING
is not defined.It does not allow to check the existence of a given properties, and compile different pieces of code depending on the existence (or not) of the property:
Any idea on how to do this ?
The text was updated successfully, but these errors were encountered: