|
-
May 27th, 2009, 09:00 AM
#1
[RESOLVED] Initialisation Lists
Hi, was just going through my uni notes and found a question I can't find the answer to.
What is the difference between the following?
Code:
TextBox (const string &text, const Vector2f &position, bool visible) :
_text(text), _position(position), _visible(visible) {}
And
Code:
TextBox (const string &text, const Vector2f &position, bool visible) :
_position(position), _text(text), _visible(visible) {}
does it actually make a difference?
-
May 27th, 2009, 09:04 AM
#2
Re: Initialisation Lists
There is no difference since the order of construction of member variables depends on their order of declaration in the class definition.
-
May 27th, 2009, 09:10 AM
#3
Re: [RESOLVED] Initialisation Lists
-
May 27th, 2009, 12:50 PM
#4
Re: [RESOLVED] Initialisation Lists
If you open up your compiler then you may find the difference in the orders of variable initialization and nothing more than writing a+b in place of b+a.
-----
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|