How to check (without Boost or other nonstandard lib) if type passed to template is an enum type?
Thanks.
How to check (without Boost or other nonstandard lib) if type passed to template
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looking at http://www.boost.org/doc/libs/1_44_0/boost/type_traits/is_enum.hpp,
If this evaluates to
true:Then this base template is selected:
Otherwise check if it’s convertible to
int:If you want to do it as well as Boost, you’ll have to define all those other traits.
<type_traits>is like that.