Boost logo

Boost :

Subject: Re: [boost] [Hana] Formal review for Hana
From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2015-06-22 09:32:38


On Sat, Jun 20, 2015 at 4:17 PM, Louis Dionne <ldionne.2_at_[hidden]> wrote:

> Zach Laine <whatwasthataddress <at> gmail.com> writes:
>
> >
> > On Thu, Jun 18, 2015 at 4:27 PM, Louis Dionne <ldionne.2 <at> gmail.com>
> wrote:
> > > [...]
> > >
> > > To get there, I'd like to make sure I understand exactly what operation
> > > you're trying to avoid. Let's assume you wrote the following instead of
> > > a transform_mutate equivalent:
> > >
> > > hana::tuple<T...> xs{...};
> > > hana::tuple<U...> ys;
> > > ys = hana::transform(xs, f);
> > >
> > > This will first apply f() to each element of xs(), and then store the
> > > temporary values in a (temporary) tuple by moving them into place. This
> > > will then move-assign each element from the temporary tuple into ys.
> > >
> > > __Is the first move what you are trying to avoid?__
> > >
> >
> > No, I'm trying to get rid of the temporary altogether. We all know that
> > copies of temporaries get RVO'd out of code like the above a lot of the
> > time, *but not always*. I want a guarantee that I don't need to rely on
> > RVO in a particular case, if efficiency is critical.
>
> Sorry I'm being so slow, but do you mean get rid of the temporary tuple or
> the temporary value? Regarding the temporary value,

Not this.

[snip]

> I'll take it that you want to get rid of the temporary tuple.

This.

Zach


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk