This is what initializer lists are for. Consider this:
1 2 3 4 5 6 7 8
class X
{
int x;
public:
X() : x(0) {} //initializes x to 0
X(constint& x) : x(x) {} //initializes this->x to the parameter x
X(const X& from) : x(from.x) {} //initializes x to the x in the other X object
};
You can separate multiple constructor calls with a comma , and you can still put code in the braces {} which will be executed after the initializer lists calls the constructors.
This currently only works for members. C++0x supports delegating constructors, but until now this usually has been done with some sort of init function.