This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Skipping RVO
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: navin p <navinp1281 at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 12 Aug 2014 10:44:57 +0100
- Subject: Re: Skipping RVO
- Authentication-results: sourceware.org; auth=none
- References: <CAKVd3pXKDYnwNwDTP6PR9cDzH_4cQLpDKy7f4StQMhPUzpaO3w at mail dot gmail dot com>
On 12 August 2014 04:37, navin p wrote:
> Hi,
> Is there any way to skip RVO using code. I know that g++ has a
> -fno-elide-constructors . But i have to change the library for lot of
> platforms and different compilers like gcc,clang,xlC,SunStudio,aCC
> etc. I read that compiler is free to do the RVO as said by the
> standard. But is there a way to prevent it for all compilers like
> specifying some snippet?
No. If your code relies on elision not happening then your code is broken.