Black Magic using Initializer_list and pack expansion
问题 To expand flexible function parameters, there is a method using std::initializer_list . However I couldn't understand it. Can anyone explain this in an understandable way? template<typename T, typename... Args> auto print(T value, Args... args) { std::cout << value << std::endl; return std::initializer_list<T>{([&] { std::cout << args << std::endl; }(), value)...}; } 回答1: This is a very confused way of doing things, but C++14 requires that we do something similar. I'll explain the limitations