Re: an rvalue reference question

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

 



Hi Chih-Long,

> blah z((blah())); // expecting calling blah::blah() and blah::blah(blah&&) but
got only blah::blah()

C++ allows this to be optimized, by eliding the copy constructor.  This
optimization is in the ISO 14882 specification.

This C++ optimization will occur even if you¹ve disabled GCC¹s optimizations
(-O0).

Try this flag to disable the C++ optimization:  -fno-elide-constructors

HTH,
<Eljay



[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