fork download
  1. #include <iostream>
  2.  
  3. template<typename T>
  4. T f()
  5. {
  6. static double staticLocalVariable = 100.0;
  7. struct local
  8. {
  9. static double f() { return staticLocalVariable=10; }
  10. };
  11. return local::f();
  12. }
  13.  
  14. int main() {
  15. std::cout << f<double>() << std::endl;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/ja4XWh/ccAoJ9Bk.o: In function `main':
prog.cpp:(.text+0x13): undefined reference to `staticLocalVariable'
collect2: ld returned 1 exit status
stdout
Standard output is empty