On Mon, Feb 11, 2008, Amos Jeffries wrote: > > It took me quite a while to get over the "goto is evil, never ever use it" > > koolaid. But then, in C++, you should be using exceptions, not weird > > flow control tricks. :) > > I've never fully subscribed to that generalisation. But the arguments made > in its favour have made me think about the necessity of several constructs > use in code. > In general I have found goto is largely useless. Where its most tempting > is in badly designed code. > typedef has its place in C particularly for portability issues, but that > is vastly reduced in C++. I've only seen the event/callback > function-pointers as a required use for it nowadays. That only because > none has shown me a better way to do function pointers than the way squid > currently does them.
I'm pretty sure the async calls stuff has an implementation of this. There's other ways - look at asio.sourceforge.net's implementation which uses some Boost methods for creating 0, 1 and 2 argument callbacks of varying types. Adrian