c++では、これを回避する方法ないよね
http://user.ecc.u-tokyo.ac.jp/~tt076524/onlispjhtml/variableCapture.html