SFINAE to have a class member only if possible
问题 I have made a type-safe ID class, but now I want to support operator++ if the underlying type also has it. From this and this answears I have come up with 2 alternatives, but they both fail when instantiated with AId: template<typename T, typename TID = unsigned int> struct AId { typedef AId<T, TID> type; typedef T handled_type; typedef TID value_type; private: value_type id; template<typename _T> struct IsIncrementable { template<typename _U> using rm_ref = typename std::remove_reference<_U>