Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.tuple] Nested tuples and tie
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-12-17 09:17:24


AMDG

Julius Ziegler wrote:
> is there a way to make constructs like this one work?
>
> double a, b, c;
>
> tie( tie( a, b ), c ) = make_tuple( make_tuple( 1., 2. ), 3. );
>
> This leads to the first parameter of the "outer" tie getting initialised by the
> return value of the "inner" tie. That means a temporary gets passed by
> reference, and the compiler (sort of reasonably) doesnt want to do this.
>

I think that you would have to use ref.

make_tuple(tie(a, b), ref(c)) = ...

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net