mixing CRTP with SFINAE
I have a base taking derived type as template parameter. The following code works as expected. instantiation of base<non_default_impl> uses non_default_impl::data_t and base<default_impl> throws compilation error because event_data is only a forward declaration. template <typename T> struct event_data; template<typename T> struct tovoid { typedef void type; }; template <typename T, typename enable = void> struct get_data{ typedef event_data<T> type; }; template <typename T> struct get_data<T, typename tovoid<typename T::data_t>::type >{ typedef typename T::data_t type; }; template <typename T>