The following code example is taken from the book
C++17 - The Complete Guide
by Nicolai M. Josuttis,
Leanpub, 2017
The code is licensed under a
Creative Commons Attribution 4.0 International License.
template<typename T>
const T& spaceBefore(const T& arg) {
std::cout << ' ';
return arg;
}
template <typename First, typename... Args>
void print (const First& firstarg, const Args&... args) {
std::cout << firstarg;
(std::cout << ... << spaceBefore(args)) << '\n';
}