The answers to the question on how to avoid undefined execution order for the constructors when using std::make_tuple led to a discussion during which I learned that the ord
Can the guarantees to constructors be used to build a function call facility ("function_apply()") with an ordering guarantee for the evaluation of arguments?
Yes, the Fit library already does this with fit::apply_eval:
auto result = fit::apply_eval(f, [&]{ return foo() }, [&]{ return bar(); });
So foo()
will be called before bar()
.