Mathias Gaunard wrote:
On 24/08/2014 13:29, Adam Wulkiewicz wrote:
The usage should be as close to std::vector as possible, so e.g.:
tuple_vector<std::tuple<T1, T2, T3, ...>> v; v.resize(count);
for (int i = 0; i < count; ++i) { T1 t = std::get<0>(v[i]); std::get<0>(v[i]) = ...; }
A thing worth noticing is that the tuple_vector's reference type is a tuple of references:
std::tuple<T1&, T2&>
Could also be any proxy type, that's more flexible. The important aspect is that tuple_vector's reference cannot be value_type&.
Yes. During my tests I ended up wrapping this tuple of references in order to emulate e.g. rvalue references, conversions between references, collapsing, etc. The "basic" tuples doesn't support every operation that's needed to emulate the standard semantics. In the prototype not all everything is functioning, I stopped as some point when I noticed where it leads to and just tested some basic usage. Regards, Adam