From: Miro Jurisic (macdev_at_[hidden])
Date: 2004-07-07 18:22:54
In article <40EC84D1.5060604_at_[hidden]>, Darren Cook <darren_at_[hidden]> wrote:
> I'm not sure which of a/b/c I am, but if I saw the below code I would be
> surprised if foo() was not evaluated before bar(). If it was a function:
> f( foo(), bar() );
> would foo() always be executed before bar()?
No. This is a common misconception and a common source of bugs that only show up
when optimizations are turned on. It's also a source of exception-unsafe code,
as detailed in Exceptional C++ and a GOTW column.
-- If this message helped you, consider buying an item from my wish list: <http://web.meeroh.org/wishlist>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk