fork(1) download
  1.  
  2.  
  3. template <class T> int bit_sizeof(T unused) {
  4. long long a,b,c;
  5. T x;
  6. x^=x;
  7. x|=1;
  8. a=b=c=x;
  9. b<<=8;
  10. c<<=3;
  11. x=b;
  12. while (x) {
  13. a<<=1;
  14. b<<=c;
  15. c<<=1;
  16. x=b;
  17. }
  18. return a;
  19. }
  20.  
  21.  
  22. int main() {
  23. int* pInt;
  24. unsigned i = bit_sizeof(pInt);
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int bit_sizeof(T) [with T = int*]':
prog.cpp:24:   instantiated from here
prog.cpp:6: error: invalid operands of types 'int*' and 'int*' to binary 'operator^'
prog.cpp:6: error:   in evaluation of 'operator^=(int*, int*)'
prog.cpp:7: error: invalid operands of types 'int*' and 'int' to binary 'operator|'
prog.cpp:7: error:   in evaluation of 'operator|=(int*, int)'
prog.cpp:8: error: invalid conversion from 'int*' to 'long long int'
prog.cpp:11: error: invalid conversion from 'long long int' to 'int*'
prog.cpp:16: error: invalid conversion from 'long long int' to 'int*'
stdout
Standard output is empty