xand yinitialized with a copy to a Tvalue-initialized value.
From the C ++ 03 standard, §8.5 / 7:
An object whose initializer is an empty set of brackets, i.e. (), must be initialized with a value.
And from § 8.5 / 5:
To initialize the value of an object of type Tmeans:
- If it
Tis a class type with a constructor declared by the user, then the default constructor for is called T(and initialization is poorly formed if it Tdoes not have an accessible default constructor); T - , , T ;T - , ;
T :
T , 0 (), T;T - , ;T - , , ) ;T - , ;T , .
x(T()),y(T()) x(),y(), value-initialize x y. ( , T ), , , , .