How to write a function pointer with a parameter pack along with its expansion?

Viewed 30

To my understanding the same thing is happening to std::thread's constructor where the first parameter is the address of a function, and the rest are its parameters. I basically want the same thing with the constructor. After the syntax i would need a way to expand the pack from the parameters example. This is what i tried

template<typename... Args>
void fun(void (*funptr)(Args)...)
    {
        int value = sizeof...(Args);
        if (value > 0)
        {
            //Expansion Here
        }
    }
0 Answers
Related