Skip to content

Instantly share code, notes, and snippets.

@mbolt35
Created June 29, 2016 15:30
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 mbolt35/dc58ab1c67f6980d1f301f11ceb06e46 to your computer and use it in GitHub Desktop.
Save mbolt35/dc58ab1c67f6980d1f301f11ceb06e46 to your computer and use it in GitHub Desktop.
template<class T, class...Ts>
container<T, Ts...> make_container(T value, Ts... values) {
// Print the total number of arguments passed in.
// We'll use the sizeof.. builtin to determine this for
// variadic args and increment once for the single T arg
std::cout << "Total Args: " << (sizeof...(values) + 1) << std::endl;
return container<T, Ts...>(value, values...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment