— I've just found out that your code has undefined behaviour. Initialize output to 1;
I'll give you a solution. It's the fully generalized version for C++20 (I did it for fun), so it may not fit your purpose:https://godbolt.org/z/5m263Z
— Ohhh okay. Thank You sir 😃
— And does the right to left precedence holds true even for function call?fun(x++, ++x);Or is it still UB in C++17?
Message permanent page
— Left and right does apply in regards to the assignment operator [expr.ass].For function calls in c++ C++17 it's no longer undefined behavior but it's unspecified instead.From [expr.call] "The initialization of a parameter, including every associated value computation and side effect, is indeterminately sequenced with respect to that of any other parameter."
— Explanation pls
— Hello house, please I need a strong and comprehensive ebook on c++
— Undefined or unspecific behavior
— English only