consider these functions:
void foo()
{
cout << "foo() called;
}
void sayhello( std::string& msg ){
msg = "something" ;
}
int add( int x, int y)
{
return x + y;
}
typedef void (*fooFunc)();
typedef std::map<std::s tring, fooFunc> Processing_Map;
...
Processing_Map table;
table["foo"] = foo;
table["sayhello"] = ???
table["add"]= ???
how to map table["sayhello"] to sayhello function, considering it has
a parameter
also the "add"
and how to actually pass a parameter value to those mapped functions
--leaf
void foo()
{
cout << "foo() called;
}
void sayhello( std::string& msg ){
msg = "something" ;
}
int add( int x, int y)
{
return x + y;
}
typedef void (*fooFunc)();
typedef std::map<std::s tring, fooFunc> Processing_Map;
...
Processing_Map table;
table["foo"] = foo;
table["sayhello"] = ???
table["add"]= ???
how to map table["sayhello"] to sayhello function, considering it has
a parameter
also the "add"
and how to actually pass a parameter value to those mapped functions
--leaf
Comment