Possible Duplicate:
Benefits of Initialization lists
I was wondering if there was an advantage to initializing members with the initializer list over putting these in the constructor. Certain things have to use the initialize list but for the majority of things that don’t, is there a difference? I prefer the latter because when I have multiple constructors, I prefer simply calling construct() to promote code reuse.
Thanks
If you don’t use the initializer list, the member or base class gets default constructed before the opening curly brace.
So, your calls to set it later will add an
operator=()call.If you use the initializer list, the member or base class has the proper constructor called.
Depending on your classes, this might be required or faster.