fork download
  1. #include <type_traits>
  2. #include <stddef.h>
  3.  
  4. template <size_t N>
  5. struct i { enum { value = N }; };
  6.  
  7. template <typename T>
  8. struct is_complete {
  9. template <typename T1>
  10. static i<sizeof(T1)> test(int);
  11. template <typename>
  12. static i<23> test(...);
  13.  
  14. typedef decltype(test<T>(0)) type;
  15. };
  16.  
  17. #include <iostream>
  18.  
  19. class foo;
  20.  
  21. int main() {
  22. std::cout << is_complete<foo>::type::value;
  23. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
Standard output is empty