Tell me how to solve with the help of LAMBA-EXPRESSION problem: Write a function that calculates the sum of a list of arguments of arbitrary length with different types of list elements.
#include <iostream> #include <utility> #include<functional> template <class T> T sum(T&& t) { return t; } template <class T, class... Args> auto sum(T&& t, Args&&... args)->decltype(t + sum(std::forward<Args> args)...)) { return (t + sum(std::forward<Args>(args)...)); } template <class T, class... Args> using KUnaryType = std::function < T(T, Args...) >; int main() { auto h = sum(2, 2.5, ' ', false); std::cout << h << std::endl; return 0; } Code without lambda expression.