fork download
  1. #include <iostream>
  2.  
  3. template<int n> struct szt{};
  4. template<> struct szt<sizeof(int)>{typedef int type;};
  5. //#if ?
  6. template<> struct szt<sizeof(long)>{typedef long type;};
  7. //#endif
  8.  
  9. int main(){
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6: error: redefinition of ‘struct szt<4>’
prog.cpp:4: error: previous definition of ‘struct szt<4>’
stdout
Standard output is empty