This article refers to:
- Teacher Hou Jie's C++ lecture notes.
#include <iostream>
#include <bitset>
using namespace std;
void printX()
{
/*nothing.*/
}
template <typename T, typename... Types>
void printX(const T& firstArg, const Types&... args)
{
cout << firstArg << endl;
printX(args...);
}
int main()
{
printX(7.5, "hello", bitset<16>(377), 42);
return 0;
}
Results of the:
7.5
hello
0000000101111001
42