fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class OverVoid{
  6. public:
  7.  
  8. virtual ~OverVoid(){
  9. };
  10. };
  11.  
  12. class Meta : public OverVoid{
  13.  
  14. };
  15.  
  16. template <typename T>
  17. struct is_overvoid_or_meta
  18. {
  19. static const bool value = false;
  20. };
  21.  
  22. template <> struct is_overvoid_or_meta<OverVoid>
  23. {
  24. static const bool value = true;
  25. };
  26.  
  27. template <> struct is_overvoid_or_meta<Meta>
  28. {
  29. static const bool value = true;
  30. };
  31.  
  32. template<typename _Ty>
  33. class Move
  34. {
  35. typedef typename std::enable_if<is_overvoid_or_meta<_Ty>::value, _Ty>::type Type;
  36. };
  37.  
  38. int main()
  39. {
  40. Move<OverVoid> m1;
  41. Move<Meta> m2;
  42. Move<int> m3;
  43. return 0;
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of 'class Move<int>':
prog.cpp:42:12:   required from here
prog.cpp:35:82: error: no type named 'type' in 'struct std::enable_if<false, int>'
      typedef typename std::enable_if<is_overvoid_or_meta<_Ty>::value, _Ty>::type Type;
                                                                                  ^
stdout
Standard output is empty