Re: Guaranteed copy elision

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

 



On Tue, Nov 15, 2022 at 6:48 AM Yubin Ruan via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> To be sure that a object would not be copied, we usually write something
> like
>
>          SomeBigObject obj;
>          func(&obj);
>
> while in most of the cases a one-liner like
>
>          SomeBigObject obj = func();
>
> would suffice.
>
> Is there any language facility to help us guarantee that at compile time
> (such as some kind of static_assert() ) so that we can be confident writing
> those one-liner ?

Interesting question, but unfortunately I do not have a good answer! I
can only bump the thread. ;)



[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