I have a function written in Java which accepts varargs as an argument. I wanted to port that function to C++. I tried to search but the closest I got is using std::vector of argument list. What would be the best way to convert varargs to C++? the function is as below.
public EventHandlerQueue<T> get (final EventHandler<T> ... handlers)
{
// Do something with handlers
return new EventHandlerQueue<T>(handlers)
}
Which is exactly correct, and exactly what the Java varags list actually is, just with some different syntax.