C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Constructor Chaining

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Steven T. Hatton
Guest





PostPosted: Sat Dec 16, 2006 3:51 am    Post subject: Constructor Chaining Reply with quote



A long time ago I was told there was discussion of introducing to C++ the
ability of a constructor to call another constructor of the same class.
This is a feature found in Java which seems to make a lot of sense, and, as
far as I am aware, introduces no fundamental problems. This is different
from the existing C++ facility for calling a base class constructor in the
member initialization list. What happens is that one constructor calls
another constructor of the same class as if it were any other member
function.

Has that functionality been discussed by C++ language designers?

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Vidar Hasfjord
Guest





PostPosted: Sat Dec 16, 2006 7:37 am    Post subject: Re: Constructor Chaining Reply with quote



"Steven T. Hatton" wrote:
Quote:
A long time ago I was told there was discussion of introducing to C++ the
ability of a constructor to call another constructor of the same class.
[...]
Has that functionality been discussed by C++ language designers?

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Pedro Lamarão
Guest





PostPosted: Mon Dec 18, 2006 5:07 pm    Post subject: Re: Constructor Chaining Reply with quote



On 16 dez, 05:37, "Vidar Hasfjord" <vattilah-gro...@yahoo.co.uk> wrote:
Quote:
"Steven T. Hatton" wrote:
A long time ago I was told there was discussion of introducing to C++ the
ability of a constructor to call another constructor of the same class.
[...]
Has that functionality been discussed by C++ language designers?
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf

There is an implementation for GCC here:

http://mndfck.org/~pedro.lamarao/projects/c++0x/

It is provided as a patch to the current mainline version, and has just
a couple of test cases.

--
Pedro Lamarão


---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.