
John Torjo wrote:
David Abrahams wrote:
Vladimir Prus <ghost@cs.msu.su> writes:
boost::dll plugin("foo"); plugin["bar"].as<void (void)>();
or something trickier, like:
- calling C++ functions:
plugin.call<void (void)>("bar") -- no need for "extern "C"
I love this! It would really be great!
How about something like plugin.func<void(void)>("some_func") returning a callable functor - some wrapper over boost::function,
I think last message from Sven even suggests the syntax were you get boost::function. And you don't need a wrapper, BTW, you can just bind function to a functional object which can do what you ask below
which - will work as long as the plugin is in memory - will throw otherwise
Isn't it better to always keep the plugin in memory?
- eventually have a method for knowing if you can still call this function
Ah... this would need some wrapper over boost::function indeed. - Volodya
I'd certainly have uses for this.
Best, John