What is a good alternative to this C++17 fold expression in C++14?
问题 Here is a nice, succinct fold expression based lambda in C++17: #include <cstdint> using ::std::uint64_t; constexpr auto sumsquares = [](auto... n) { return ((n * n) + ...); }; // I want this to work. uint64_t foo(uint64_t x, uint64_t y, uint64_t z) { return sumsquares(x, y, z); } // And this too double bar(uint64_t x, double y) { return sumsquares(x, y); } I have this code I've written to do something similar in C++14, but it seems a lot more verbose and confusing than it should be. I'm