Created
April 10, 2015 10:02
-
-
Save termoose/4eb507c9f4817d4d8b9f to your computer and use it in GitHub Desktop.
Variadic templates
This file contains 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
void Add() { } | |
void Add(std::string data) | |
{ | |
vector.push_back(data); | |
} | |
template<typename... Args> | |
void Add(std::string first, Args... args) | |
{ | |
vector.push_back(first); | |
vector.push_back(args...); | |
} |
orbekk
commented
Apr 10, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment