P
pasa_1
Can someone clarify few items from FAQ
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6
'[10.6] Should my constructors use "initialization lists" or
"assignment"?'
a. This might happen when your class has two constructors that need to
initialize the 'this' object's data members in different orders. <--
Okay
b. Or it might happen when two data members are self-referential. <--
Can someone clarify this?
c. Or when a data-member needs a reference to the this object, and you
want to avoid a compiler warning about using the this keyword prior to
the { that begins the constructor's body (when your particular compiler
happens to issue that particular warning). ?? An example will be
helpful.
d. Or when you need to do an if/throw test on a variable (parameter,
global, etc.) prior to using that variable to initialize one of your
this members. ?? An example will be helpful.
Regards,
Manish
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6
'[10.6] Should my constructors use "initialization lists" or
"assignment"?'
a. This might happen when your class has two constructors that need to
initialize the 'this' object's data members in different orders. <--
Okay
b. Or it might happen when two data members are self-referential. <--
Can someone clarify this?
c. Or when a data-member needs a reference to the this object, and you
want to avoid a compiler warning about using the this keyword prior to
the { that begins the constructor's body (when your particular compiler
happens to issue that particular warning). ?? An example will be
helpful.
d. Or when you need to do an if/throw test on a variable (parameter,
global, etc.) prior to using that variable to initialize one of your
this members. ?? An example will be helpful.
Regards,
Manish