Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > surprised that ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 43974 of 47562
Post > Topic >>

surprised that this is valid...

by werasm <werasm@[EMAIL PROTECTED] > Mar 18, 2008 at 10:20 AM

Hi all,

I've per chance noticed that this code compiles without warnings:

struct x
{
  x(): y_( y_ ){}

  int y_;
};

I've used gcc 4.1.0, comeau online and all compilers available at
dinkumware online.

Are there cases where similar code (a member initialising itself with
itself) would make sense? I was surprised when I discovered this.

Regards,

Werner
 




 11 Posts in Topic:
surprised that this is valid...
werasm <werasm@[EMAIL   2008-03-18 10:20:42 
Re: surprised that this is valid...
"jason.cipriani@[EMA  2008-03-18 11:14:03 
Re: surprised that this is valid...
Paul Brettschneider <p  2008-03-18 23:02:08 
Re: surprised that this is valid...
Jeff Schwab <jeff@[EMA  2008-03-18 15:21:50 
Re: surprised that this is valid...
Paul Brettschneider <p  2008-03-18 23:49:43 
Re: surprised that this is valid...
Jeff Schwab <jeff@[EMA  2008-03-18 16:22:17 
Re: surprised that this is valid...
Paavo Helde <nobody@[E  2008-03-18 14:59:58 
Re: surprised that this is valid...
Jeff Schwab <jeff@[EMA  2008-03-18 13:18:12 
Re: surprised that this is valid...
"jason.cipriani@[EMA  2008-03-18 13:32:17 
Re: surprised that this is valid...
Greg Herlihy <greghe@[  2008-03-18 15:26:17 
Re: surprised that this is valid...
"jason.cipriani@[EMA  2008-03-18 16:22:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:47:14 CDT 2008.