Created
May 19, 2016 10:08
-
-
Save r-lyeh-archived/b3c4b21fa19ccb683c944b87baca51e5 to your computer and use it in GitHub Desktop.
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
#include <string> | |
#include <iostream> | |
#include <utility> | |
void internal_func(const std::string& s) | |
{ | |
std::cout << s << '\n'; | |
} | |
template <typename ... T> | |
void do_with_string(T&& ... t) | |
{ | |
internal_func({std::forward<T>(t)...}); | |
} | |
int main() | |
{ | |
do_with_string("foobar", 3U); | |
do_with_string(std::string("bar")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment