So I'm making setTimeout and setInterval functions.
I have this remember function (that is part of Timing class) which takes a function pointer and a void pointer, which are remembered in that object.
Another (timing) function of that object is called in every loop of the program and when specific time passes that function calls the remembered function whit the remembered void pointer as argument.
The problem is that the functions that need to be called require unknown multiple parameters, so what I need to do is make a new class that will store the needed arguments. I make the function that needs to be called and that storage object and pass pointers to them to my remember function, when the remembered function is called it stores the data from storage object in new variables and dose it's thing.
Now this can get very messy so I need a simpler way to give arguments to functions, dose anyone have an idea how? Any idea is welcome.
That is a bit confusing.
But I figured out I can use template<class T> to make my function take pointer to unknown class and pointer to a function that takes pointer to that class as parameter.
This is a bit better since I now use reference to that object rather than void pointer to it.