Skip to content

Instantly share code, notes, and snippets.

@r-lyeh-archived
Created May 19, 2016 10:08
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 r-lyeh-archived/b3c4b21fa19ccb683c944b87baca51e5 to your computer and use it in GitHub Desktop.
Save r-lyeh-archived/b3c4b21fa19ccb683c944b87baca51e5 to your computer and use it in GitHub Desktop.
#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