This is the mail archive of the
mailing list for the libstdc++ project.
Re: [v3] constexpr tuple
On Thu, 8 Sep 2011, Marc Glisse wrote:
On Thu, 8 Sep 2011, Christopher Jefferson wrote:
This might be totally insane, but I believe that:
tuple_cat(tuple_cat(A,B), C) always equivalent to tuple_cat(A,B,C);
That's a fine way to find the return type, but for code, doesn't it generate
many copies? I think I'd forward_as_tuple and use some magic indices to
extract everything at once.
Or as an alternative, we could have f<3>(tuple0,tuple1,tuple2) call (with
proper forwarding) f<2>(tuple1,tuple2,x01,x02) which calls
f<1>(tuple2,x01,x02,x10,x11,x12,x13) which calls
f<0>(x01,x02,x10,x11,x12,x13,x20) which is what the tuple constructor
needs. This avoids the forward_as_tuple.