I want to create a vector / deque as a function container.
This deterrent must accept different functions with different arguments.
Examples of functions:
program_data::getInstance().function(int,std::string); program_data::getInstance().foo(int); program_data::getInstance().exam(int,std::string,double);
And you can show a code example how to put these functions with arguments in std :: vector / std :: deque and execute ?
I think I should use std :: function and std :: bind, but I don't know how to support different functions with different args sizes.
With arguments -> my functions (called function foo exam from program_data ) perform some actions using arguments.
For example: I usually execute this function:
program_data::getInstance().function(10,"halo");
And now I want to put these functions in std::vector // deque and execute with the arguments that I set with the function. ie (if I put the function above on the vector and use (pseudo-code) vector[0].run(); then my program start function is program_data::getInstance().function(int,std::string); )
source share