fork download
  1. template<bool> struct Range;
  2.  
  3. template<int value, typename = Range<true> > struct Unique;
  4. template<int value> struct Unique<value, Range<(value > 1)> > { typedef char type[1]; };
  5. template<int value> struct Unique<value, Range<(value > 2)> > { typedef char type[2]; };
  6.  
  7. Unique<3>::type o1;
  8. Unique<3>::type o2;
  9.  
  10. int main ()
  11. {
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: error: ambiguous class template instantiation for ‘struct Unique<3, Range<true> >’
prog.cpp:4: error: candidates are: struct Unique<value, Range<(value > 1)> >
prog.cpp:5: error:                 struct Unique<value, Range<(value > 2)> >
prog.cpp:7: error: ‘type’ in class ‘Unique<3, Range<true> >’ does not name a type
prog.cpp:8: error: ‘type’ in class ‘Unique<3, Range<true> >’ does not name a type
stdout
Standard output is empty