public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Min Xu <mxu@cae.wisc.edu>
To: gcc@gcc.gnu.org
Subject: "self" constructor
Date: Wed, 22 Mar 2000 17:22:00 -0000	[thread overview]
Message-ID: <38D971CA.BED14EFD@cae.wisc.edu> (raw)

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

             reply	other threads:[~2000-03-22 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-22 17:22 Min Xu [this message]
2000-03-22 17:53 ` Alexandre Oliva
2000-03-23  0:59 ` Martin v. Loewis
2000-03-23  6:35   ` Min Xu
2000-03-23  9:21     ` Martin v. Loewis
2000-03-22 19:07 Mike Stump
2000-03-23  6:40 ` Min Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38D971CA.BED14EFD@cae.wisc.edu \
    --to=mxu@cae.wisc.edu \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).