Created
February 19, 2017 15:07
-
-
Save Panchatcharam/55d3814f457c1ee427249b3d4b863a15 to your computer and use it in GitHub Desktop.
Simple program which use variadic template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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