Boost logo

Boost Users :

From: Fred J. (phddas_at_[hidden])
Date: 2006-11-09 03:18:56


Hi

is there a way to convert a string to a function name and fire it. like
void his_fun(){
  cout << "his is here" << endl;
}

vector<string> vec;
vec.push_back("his");
vec.push_back("me");

for(i=0; i<vec.size(); i++)
  string var = vec[i] + _fun;
  fire(var); and it will fire the routine "his_fun?

is so, how?

what whole idea is to avoid typing
vector<func_ptr> vec;
vec.push_back( &func_1 );
vec.push_back( &func_n );
...
thanks

 
---------------------------------
Everyone is raving about the all-new Yahoo! Mail.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net