Constructors can initialise through assignment operator or initialisation lists. Benefit of using initialisation lists is the improved performance. Your code will run faster if you use initialization lists rather than assignment.
Constructors can initialise through assignment operator or initialisation lists. Benefit of using initialisation lists is the improved performance. Your code will run faster if you use initialization lists rather than assignment.
Besides the fact the two constructors are from different classes. What is the difference of writing it the first way apposed of writing it the second way?
I noticed that the first initializes the members after a colon and the second initializes the members inside the curley braces. So what is the difference?
Oh man you didn't read the link....
You can do both ways...first one through initilisation lists and second one is through assignment operator.
First one is better...for more information read my first post.
Oh so my first post was using an initializing list. I was under the impression that it was the same as an assignment constructor, just written in "shorthand" I thought. So when you use an assignment constructor it passes a temporary object that isn't efficient. Yet an initializing list does it all in one instance. Cool
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.