fork download
  1. template<int src, int dst>
  2. struct move_disc
  3. {
  4. struct lol
  5. {
  6. lol()
  7. {
  8. move_disc<src, dst>::rotfl;
  9. }
  10. };
  11. };
  12.  
  13. template<int n, int src, int tmp, int dst>
  14. struct hanoi
  15. {
  16. hanoi<n-1, src, dst, tmp> before;
  17. typename move_disc<src, dst>::lol disc;
  18. hanoi<n-1, tmp, src, dst> after;
  19. };
  20.  
  21. template<int src, int tmp, int dst>
  22. struct hanoi<0, src, tmp, dst>
  23. {
  24. // recursive base case
  25. };
  26.  
  27. hanoi<3, 1, 2, 3> go;
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘move_disc<src, dst>::lol::lol() [with int src = 1; int dst = 3]’:
prog.cpp:14:8:   required from here
prog.cpp:8:7: error: ‘rotfl’ is not a member of ‘move_disc<1, 3>’
       move_disc<src, dst>::rotfl;
       ^
prog.cpp: In instantiation of ‘move_disc<src, dst>::lol::lol() [with int src = 1; int dst = 2]’:
prog.cpp:14:8:   required from here
prog.cpp:8:7: error: ‘rotfl’ is not a member of ‘move_disc<1, 2>’
prog.cpp: In instantiation of ‘move_disc<src, dst>::lol::lol() [with int src = 3; int dst = 2]’:
prog.cpp:14:8:   required from here
prog.cpp:8:7: error: ‘rotfl’ is not a member of ‘move_disc<3, 2>’
prog.cpp: In instantiation of ‘move_disc<src, dst>::lol::lol() [with int src = 2; int dst = 1]’:
prog.cpp:14:8:   required from here
prog.cpp:8:7: error: ‘rotfl’ is not a member of ‘move_disc<2, 1>’
prog.cpp: In instantiation of ‘move_disc<src, dst>::lol::lol() [with int src = 2; int dst = 3]’:
prog.cpp:14:8:   required from here
prog.cpp:8:7: error: ‘rotfl’ is not a member of ‘move_disc<2, 3>’
stdout
Standard output is empty