Binding Variadic Parameters
Binding Variadic Parameters
Is this a stack overflow-worthy question?
Anyways, suppose I have a function here:
void urmom(size_t size, std::string name);
binding this would be quite simple:
std::bind(urmom, 500, std::placeholders::_1);
But what if I had a variadic argument function?
template <typename... T>
void urmom_n_friends(size_t size, T... friends);
// overload
void urmom_n_friends(size_t size, Mom friends);
Obviously I can't just do:
std::bind(ur_n_mom, 500, _1);
I'm thinking something about recursion (as that is how you implement such functions), but I don't know what...
Free cycles: @mocaCDEveloper @DynamicSquid @fuzzyastrocat @xxpertHacker
feel free to say hit that check mark lol
Coder100 (17038)
ok all jokes aside, I asked the question here:
https://stackoverflow.com/questions/65015006/binding-variadic-functions-c/65015034
lambdas go brr
I saw this and was gonna do the following:
a) Mention
std::bind
(but you already know about that)b) Tell you to literally ping me from now on about C++ lol (but you already did that too)
Lmao, why did I never get the ping?
Maybe Repl.it thought you were spamming.
Okay, I'm going to open up a C++ Repl and cook something up.
@xxpertHacker Nvm, was solved in the SO question.
Should put it in the post/title that it has since been solved.
That's what I do when SO answers first.