fork download
  1. #include <type_traits>
  2. #include <iostream>
  3.  
  4. struct my_abstract_class { virtual int x() = 0; };
  5. struct my_incomplete_class;
  6.  
  7. int main()
  8. {
  9. ::std::cout
  10. << std::is_convertible<int, int>::value << ::std::endl
  11. << std::is_convertible<int[], int[]>::value << ::std::endl
  12. << std::is_convertible<int[2], int[2]>::value << ::std::endl
  13. << std::is_convertible<int(), int()>::value << ::std::endl
  14. << std::is_convertible<my_abstract_class, my_abstract_class>::value << ::std::endl
  15. << std::is_convertible<my_incomplete_class, my_incomplete_class>::value << ::std::endl
  16. ;
  17. return 0;
  18. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
1
0
0
0
0
0