fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T>
  5. void foo(T t) {
  6. static_assert(false, "specialized versions only");
  7. }
  8.  
  9. template<>
  10. void foo(int i){}
  11.  
  12.  
  13. int main() {
  14.  
  15. foo(42);
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void foo(T)’:
prog.cpp:6:2: error: static assertion failed: specialized versions only
  static_assert(false, "specialized versions only");
  ^~~~~~~~~~~~~
stdout
Standard output is empty