#Using an array as a placeholder for multiple function arguments

13 messages · Page 1 of 1 (latest)

south kelpBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

honest mason
#

Just pass the actual vector

flint glen
#

👆

#

if you want the number of elements to be set in stone for the function to be called, use std::array<T, N>, where T is your type and N the number of elements

#

and guessing what you're thinking of is argument unfolding as done in python, no there's no way to actually do that in C++

cold geyser
#

this can be done with a tuple

#

using std::apply

flint glen
#

isn't this meant for instantiating templates?

cold geyser
#

that doesn't mean that it isn't sufficient for this case

#

you can take a tuple and the unpack it

flint glen
#

oh well then, I retract my previous statement

#

TIL, thanks cat_up

south kelpBOT
#

Thank you and let us know if you have any more questions!