What's the difference between Object obj(args...) and Object obj{args...}? and why Scott says so.
The difference is that in the former case, the order of evaluation of arguments is unsequenced (i.e unspecified) but in the latter case, the order is left-to-right (i.e in which they appear).
The following text from $5.2.2/8 [expr.call] (n3690) deals with Object(args...)
form:
The evaluations of the postfix expression and of the arguments are all unsequenced relative to one another. All side effects of argument evaluations are sequenced before the function is entered (see 1.9).
And the text from $8.5.4/4 [dcl.init.list] (n3690) deals with Object{args...}
form:
Within the initializer-list of a braced-init-list, the
initializer-clauses, including any that result from pack expansions
(14.5.3), are evaluated in the order in which they appear. That is,
every value computation and side effect associated with a given
initializer-clause is sequenced before every value computation and
side effect associated with any initializer-clause that follows it in
the comma-separated list of the initializer-list.[ Note: This
evaluation ordering holds regardless of the semantics of the
initialization; for example, it applies when the elements of the
initializer-list are interpreted as arguments of a constructor call,
even though ordinarily there are no sequencing constraints on the
arguments of a call. — end note ]
Well which means this:
int f() { static int i = 10; return ++i; } //increment the static int!
Object obj(f(), f()); //is it obj(11,12) or obj(12,11)? Unspecified.
Object obj{f(), f()}; //it is obj(11,12). Guaranteed.
Note that GCC (4.7.0 and 4.7.2) have a bug because of which {}
form doesn't work the way it should. I'm not sure if it is fixed in the current version.
Hope that helps.