I would like to give an instruction as a parameter:
execute_at_frame(int frame_number, <instruction>)
{
for(f = 1 ; f < F_MAX ; f++)
{
/* other instructions */
if (f == frame_number)
/* execute <instruction> */
/* other instructions */
}
}
- One type of call:
execute_at_frame(5,execute(42)); - Another type of call:
execute_at_frame(6,process());
Is that (or something similar) possible?
Thanks in advance 🙂
Yes, if you use
std::bind(C++11):Otherwise you’ll have to prepare a interface for instructions.