I would like to store the initialization values for elements in a tuple inside a separate tuple, so that I can use the same values as a preset for other tuples of the respective
There is no requirement in the standard for the order of std::tuple
member initialisation, I am afraid.
You can iterate over a tuple
in a specific order though, e.g.:
#include
#include
#include
#include
int main()
{
auto a = std::make_tuple(true, 42, 3.14, "abc");
boost::fusion::for_each(a, [](auto& value) {
std::cout << value << '\n';
});
}
Outputs:
1
42
3.14
abc