
Dear list, 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. Best regards, Julius

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
participants (2)
-
Julius Ziegler
-
Steven Watanabe