Do we have a function pointer that points to a function using a variable argument list? For example, let's say I need to select a function from among the functions based on some input T 'input'. Can I use an STL card like this?
template<typename T> map<T, T (*)(T, ...)> func_map;
If possible, you can say that I will do it right to do it from a design point of view.
[Edit] Actually, I have a set of algorithmic functions, and I have a message field. I need to select this algorithmic function based on several bytes in this post. I was thinking of using hash_map with the key value wrt pointer to this algorithmic function. I wanted to be very fast depending on performance, which could be an easy way to implement this.
Also, the reason I don't choose a simple if-else or switch block for this is because the value that tells us about the function to be executed may refer to some other function at a later point.
source share