Re: copy ctor not called

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux