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

enable_if typedefs are not idiomatically named #66

Closed
bkietz opened this issue Jul 30, 2020 · 2 comments
Closed

enable_if typedefs are not idiomatically named #66

bkietz opened this issue Jul 30, 2020 · 2 comments

Comments

@bkietz
Copy link
Collaborator

bkietz commented Jul 30, 2020

Names matching /is_\w+/ are conventionally reserved for bool_constants, but in cpp11 they connote a typedef of enable_if, for example (as.hpp:24):

template <typename T>
using is_integral = typename std::enable_if<
    std::is_integral<T>::value &&
        !std::is_same<typename std::decay<T>::type, bool>::value &&
        !std::is_same<typename std::decay<T>::type, char>::value,
    typename std::decay<T>::type>::type;

The prefix enable_if_ will make it clearer to newcomers that this is an SFINAE helper.

@jimhester
Copy link
Member

Sounds like a good suggestion to me.

@bkietz
Copy link
Collaborator Author

bkietz commented Aug 5, 2020

fixed in #72

@bkietz bkietz closed this as completed Aug 5, 2020
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