Substitution failure is not an error (SFINAE) for enum
问题 Is there a way to use Substitution failure is not an error (SFINAE) for enum? template <typename T> struct Traits { } template <> struct Traits<A> { }; template <> struct Traits<B> { enum { iOption = 1 }; }; template <T> void Do() { // use Traits<T>::iOption }; Then, Do<B>(); works and Do<A>(); fails. However, I can supply a default behavior when iOption does not exist. So I separate out some part of Do to DoOption. template <typename T, bool bOptionExist> void DoOption() { // can't use