public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jeroen Wijnhout" <jeroen@wijnhout.com>
To: gcc-help@gcc.gnu.org
Subject: Re: copy ctor not called
Date: Thu, 07 Jul 2005 11:45:00 -0000	[thread overview]
Message-ID: <62024.195.64.81.210.1120736719.squirrel@userservices.server15.firstfind.nl> (raw)
In-Reply-To: <6.2.1.2.2.20050705090751.0243dd68@iplan-mn.corp.adobe.com>

> Hi Jeroen,
>
>>To me this says, that I -fno-elide-constructors should be the default
>> behavior. Which it isn't (at least for gcc 3.3.4).
>
> Due to the design and evolution of C++, your expectation that
> "-fno-elide-constructors should be the default behavior" is not the case.
>
> I can understand where a person would expect that to be the situation.
>
> However, C++ standard has the elide "optimization" be the default behavior
> for proper C++, and the -fno-elide-constructors is a non-compliant
> pessimization.

Hmm, I have the 2005 edition of "C++ Primer", which I kind of trusted
because one of the authors was involved in the C++ ISO standards
committee. They write
in section 13.1 (page 477):
"Copy-initialization always involves the copy constructor".
According to your statement they are wrong.

> Moreso, you've touched up the (surprising?) requirement for the copy
> constructor to be public.
>
> These C++ anachronisms are due in large part to the design and evolution
> of C++.  They are legacy warts.

Thanks for your explanation.

best,
Jeroen

  reply	other threads:[~2005-07-07 11:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-02 18:21 Jeroen Wijnhout
2005-07-02 19:17 ` Travis Spencer
2005-07-03  8:15   ` Jeroen Wijnhout
2005-07-03 12:27 ` Dirk Jagdmann
2005-07-03 13:44   ` Jeroen Wijnhout
2005-07-05 14:10     ` Eljay Love-Jensen
2005-07-07 11:45       ` Jeroen Wijnhout [this message]
2005-07-07 12:02       ` Eljay Love-Jensen
2005-07-08 18:26         ` Jeroen Wijnhout

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=62024.195.64.81.210.1120736719.squirrel@userservices.server15.firstfind.nl \
    --to=jeroen@wijnhout.com \
    --cc=gcc-help@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).