How can I use std::make_tuple if the execution order of the constructors is important?
For example I guess the execution order of the constructor of class A and the
There's nothing special about make_tuple
here. Any function call in C++ allows its arguments to be called in an unspecified order (allowing the compiler freedom to optimize).
I really don't suggest having constructors that have side-effects such that the order is important (this will be a maintenance nightmare), but if you absolutely need this, you can always construct the objects explicitly to set the order you want:
A a(std::cin);
std::tuple t(std::make_tuple(a, B(std::cin)));