Add all parameters with parameter pack expansion [duplicate]
问题 This question already has answers here : How to call a function on all variadic template args? (3 answers) Closed 6 years ago . Consider I have a variadic template with int... parameters. For example a function like this: template<int... t> int add(){ return t... + ??? } All the method should do is adding all the parameters. It can be easily achieved using recursive variadic templates. However, is it also possible expressing this (or something similar like using other binary operators to