Skip to content

Instantly share code, notes, and snippets.

@mikeplavsky
Last active August 31, 2020 21:59
Show Gist options
  • Save mikeplavsky/1966b2254c84ca539a9c45b50cb9e650 to your computer and use it in GitHub Desktop.
Save mikeplavsky/1966b2254c84ca539a9c45b50cb9e650 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
using namespace std;
template <typename T, typename ... Args>
vector<T> to_vector(Args && ... args) {
}
template <typename ... Args>
void print(Args && ... args) {
auto out = [](auto x) {
cout << x << " ";
};
(out(args),...);
}
int main() {
print(1,2,3,"wow");
//auto res = to_vector<int>(1,2,3); // vector<int> res = {1,2,3}
//print(res[0],res[1]);
}
@mikeplavsky
Copy link
Author

mikeplavsky commented Aug 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment