|
-
November 17th, 2010, 05:06 PM
#16
Re: Why can't member variable be initialized?
 Originally Posted by monarch_dodra
That change was undone, see http://en.wikipedia.org/w/index.php?...ldid=387105157
-
November 17th, 2010, 05:16 PM
#17
Re: Why can't member variable be initialized?
 Originally Posted by laserlight
That was easy 
Refer to the example in n3126 clause 12.6.2 paragraph 8.
Yeah, It was right under my nose and I didn't even see it.
Looking harder, it would appear this is called a "brace-or-equal-initializer". It's not described in a single place, but spread out all over the draft...
On a related topic, when you write "constructor() : a(), b()", that is called a "mem-initializer". I'm just glad I won't have to say "constructor initializer list" when I know very well an "initializer list" is something else.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Tags for this Thread
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
|