From mboxrd@z Thu Jan 1 00:00:00 1970 From: Min Xu To: gcc@gcc.gnu.org Subject: "self" constructor Date: Wed, 22 Mar 2000 17:22:00 -0000 Message-id: <38D971CA.BED14EFD@cae.wisc.edu> X-SW-Source: 2000-03/msg00592.html Hi all, I used to be a java programmer before I recently graduated into c++. I have a question about calling a constructor of a class from another constructor of this class. I already searched the archives of this mailing list, however, I can't find answers about it. My question in detail is that why following code is rejected by gcc? (my version is 2.95.2) // test class for "self" constructor class test { private: int i; int j; public: test(int ii):i(ii) {}; test(int ii, int jj):test(ii), j(jj) {}; } I know this code is too much java-like, but my point is why it is disallowed? I guest "super()" isn't in c++ is because c++ has multi-inheritance. But why not "this()"? Thank you for your attention for reading my question. Min