
Nice idea. I wondered if it could be applied to functions or function pointers. I'm not convinced it's properly supported in this context. Anyhow, I think a 'global variable' trick works. A more elegant solution is welcome!
Volatile will have more side effects and prevent optimization that we might want the compiler to make
Thanks for that comment. I looked into the true meaning of 'volatile' and unfortunately I don't think it's quite appropriate either. I've spotted a trick in something highlighted by Joel de Guzman regarding ( I think ) the following: http://tinyurl.com/kk858o to avoid dead code and control certain cache behaviour. I think this is what I want to ensure. It appears that using boost::bind has a similar effect (at least as far as dead code is concerned) - but I do not want to rely on that. -ed ------------------------------------------------ "No more boom and bust." -- Dr. J. G. Brown, 1997