|
Boost : |
From: Andrei Alexandrescu \(See Website for Email\) (andrewalex_at_[hidden])
Date: 2004-07-07 22:10:23
"Darren Cook" <darren_at_[hidden]> wrote in message
news:40EC9169.3060409_at_dcook.org...
> >>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.
>
> That kind of validates using v+=foo(),bar(); then, but also says why you
> shouldn't use it: a common source of bugs.
>
> I think with an initialization library in particular people will write,
and
> expect to always work, something like:
> v+= get(), get(), get();
Were issues such as these brought during the review?
Andrei
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk