This is a small modification to the unpackTuple API. When using unpackTuple on a slice, the underlying array is expected to have exactly the length of the tuple. Otherwise the new error code BadTupleSize is thrown. For ArrayIterators the function was renamed to unpackPrefixAsTuple to indicate that it behaves differently. This function will forward the iterator and read the given number of elements and does not expect the iterator to be at the end position after everything was read. If you want to extract a prefix from a slice use ArrayIterator(slice).unpackPrefixAsTuple<...>() instead.
To allow unpacking of nested tuples, e.g. slice.unpack<int, std::tuple<int, int>, std::string>() an Extractor for tuples was added.
Coverage increased (+0.02%) to 96.437% when pulling 458e3fc63efbb287c89f6615b79f8a817c08c0d4 on future/unpack-tuple-mod into 6152214dab8dc54bfc0643c03b1b24d8f58cf52a on main.
This is a small modification to the
unpackTuple
API. When usingunpackTuple
on a slice, the underlying array is expected to have exactly the length of the tuple. Otherwise the new error codeBadTupleSize
is thrown. ForArrayIterators
the function was renamed tounpackPrefixAsTuple
to indicate that it behaves differently. This function will forward the iterator and read the given number of elements and does not expect the iterator to be at the end position after everything was read. If you want to extract a prefix from a slice useArrayIterator(slice).unpackPrefixAsTuple<...>()
instead.To allow unpacking of nested tuples, e.g.
slice.unpack<int, std::tuple<int, int>, std::string>()
anExtractor
for tuples was added.