Last active
August 31, 2020 21:59
-
-
Save mikeplavsky/1966b2254c84ca539a9c45b50cb9e650 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 <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]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://coliru.stacked-crooked.com/a/593add9fb8f46436