Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-11-09 04:19:05


Hi!

C++ does not support it directly. But you can use OS native System Calls. For example Windows
features:
GetProcAddress API function.

The problem here is with C++ name mangling. You must know the mangled function name.

With Kind Regards,

Ovanes Markarian

On Thu, November 9, 2006 09:18, Fred J. wrote:
> 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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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