Implementation of fully-featured C++17 variant and tuple with additional algorithms for tuple, such as:
- insertBack
- insertFront
- select
- reverse
- take
- drop
- sortByType
- replicate
- apply
- foldl
- transform
- forEach
- concatenate
and more.
Tuples also support the pipe syntax:
const auto sum = [](const auto& tuple) { return foldl(tuple, 0, std::plus{}); };
const auto s = makeTuple(1, 2, 3, 4, 5)
| take<3>
| sum;
//s == 6
Examples and details can be found in the tests of tuple and tests of variant.
Structured bindings are not supported due to some ambiguity in the get function.