C++17 fold expression in cout
问题 I am learning the new c++17 fold expression and I saw this code from c++17 fold expression. I would like to know why this code work : template<typename ...Args> void printer(Args&&... args) { (std::cout << ... << args) << '\n'; } but not this one : template<typename ...Args> void printer(Args&&... args) { (std::cout << args << ...) << '\n'; } which could seems logic too and would reverse the print order in my opinion. 回答1: As seen on cppreference, binary folds can have the following two forms