This is a follow-up to my previous question What is the order of destruction of function arguments? because I accidentally confused arguments with parameters. Thanks to Columbo and T.C. for clearing me of terminology confusion in the comments of that question.
If the body of some function f
with parameters p_1
, ..., p_n
of types T_1
, ..., T_n
respectively throws an exception, finishes or returns, in what order are the parameters destroyed and why? Please provide a reference to the standard, if possible.
Examples:
template <typename ... Args>
void f(Args ... params) {} // in what order are params destroyed?
void f(T1 p1, T2 p2, T3 p3) {} // in what order are p1, p2 and p3 destroyed?
See Question&Answers more detail:os