#include #include #include #include #include #include #include #include #include #ifdef __cplusplus #include #include #include #include #include #include #include #endif #define COINFLIP() (rand() % 2) template T adder(T v) { return v; } template T adder(T first, Args... args) { return first + adder(args...); } int main(int argc, char const *argv[]) { int sum = adder(1, 2, COINFLIP(), COINFLIP()); std::string ssum = adder(std::string("1"), std::string("2"), std::string("3"), std::to_string(COINFLIP())); std::cout << "sum: " << sum << " ssum: " << ssum << std::endl; return 0; }