I\'m trying to write a variadic template constexpr function which calculates sum of the template parameters given. Here\'s my code:
constexpr
template<
A more generic solution using std::initializer_list would be:
std::initializer_list
template auto sum_all(V... v) { using rettype = typename std::common_type_t; rettype result{}; (void)std::initializer_list{(result += v, 0)...}; return result; }