私は2つの機能を持っているとしましょう:
void a(int arg1) { ... }
void b(int arg1, arg2) { ... }
また、呼び出したい関数の名前を含む文字列と、すべてのパラメーターを含む配列もあります。
string func_name = "b"; // 'a' or 'b'
int args[] = { 1, 2 }; // has either 1 or 2 values
関数を動的に呼び出す必要があります。引数のない関数でそれを行うのは非常に簡単です。マップを作成しただけです (文字列 function_name => 関数へのポインター)。
今度は引数も渡したいので、次のように配列を実際の引数に変換します。
auto f = std::bind(b, args); // Doesn't compile, requires 1,2 as arguments
問題が明確で、解決可能であることを願っています。
ありがとう