|
Boost : |
From: Andrei Alexandrescu \(See Website for Email\) (andrewalex_at_[hidden])
Date: 2004-07-07 18:56:46
"Rob Stewart" <stewart_at_[hidden]> wrote in message
news:200407072103.i67L3Jk28273_at_tesh.systems.susq.com...
> From: brangdon_at_[hidden] (Dave Harris)
> > In-Reply-To: <cch4as$941$1_at_[hidden]>
> > andrewalex_at_[hidden] (Andrei Alexandrescu \(See Website for Email\))
> > wrote (abridged):
> > > I was worried more (only) about the order of evaluation.
> > >
> > > v += foo(), bar();
>
> Unless I'm mistaken, there is but one sequence point in such an
> expression, regardless of whether you overload operator,. Thus,
> any expression using commas must be understood to have
> indeterminant order of evaluation.
It is exactly such false sense of security and such misunderstandings that
makes me highly suspicious of overloading the comma operator. Worse,
comments come that have an apparence of legitimacy. Unless I am even more
mistaken, your statement above is false. If that's the case, hey, confusion
is among the inner circle... how about the casual users?
> Consider:
>
> int v[] = { foo(), bar() };
>
> Doesn't this exhibit the same problem?
No.
Andrei
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk