fork download
  1. #include <iostream>
  2.  
  3. template< class... >
  4. using void_t = void;
  5.  
  6. template<class, class = void_t<>>
  7. struct has_member_type : std::false_type
  8. { };
  9.  
  10. template<class T>
  11. struct has_member_type<T, void_t<typename T::type>> : std::true_type
  12. { };
  13.  
  14. int main()
  15. {
  16. std::cout << has_member_type<int>::value << '\n';
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0