Possible Duplicate:
Initializing fields in constructor - initializer list vs constructor body
In a lecture I attended, the lecturer talked briefly in C++ about non-default class constructors. He stated specifically that one version was preferable to the other. He showed these two examples:
Point::Point(double x, double y, double z)
: x_(x), y_(y), z_(z)
{}
Point::Point(double x, double y, double z)
{ x_= x; y_= y; z_= z; }
He mentioned that the first example (using parentheses) was the preferred way to write the constructor.
My question is: What's the difference and why does it matter? In what way is the first superior to the second?