fork download
  1. template<bool C, class T, class F>
  2. struct select_if
  3. {
  4. typedef T type;
  5. };
  6.  
  7. template<class T, class F>
  8. struct select_if<false, T, F>
  9. {
  10. typedef F type;
  11. };
  12.  
  13. template<class T>
  14. class A
  15. {
  16. typedef struct { } type;
  17. };
  18.  
  19. template<class T>
  20. class B : public select_if<true, A<T>, A<T> >::type
  21. {
  22. typename A<T>::type insert(); // syntax error at 'type'? Why?
  23. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty