Skip to content

Instantly share code, notes, and snippets.

@Panchatcharam
Created February 19, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Panchatcharam/55d3814f457c1ee427249b3d4b863a15 to your computer and use it in GitHub Desktop.
Save Panchatcharam/55d3814f457c1ee427249b3d4b863a15 to your computer and use it in GitHub Desktop.
Simple program which use variadic template
#include<iostream>
#include<string>
using namespace std;
// This function is required, and it will be called at the end.
void print()
{
cout<<"\n Print is Complete"<<endl;
}
// Vraidic template method
template <typename T, typename... Arguments>
void print(const T & fa, const Arguments... args)
{
cout<<fa<<endl;
print(args...);
}
int main()
{
print("Hi Panch",1,7,90.754,"Satabdi",5454646,87766);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment