
26 Feb
2010
26 Feb
'10
10:06 a.m.
Mathias Gaunard wrote:
If you want to do it for arbitrary signatures and provide perfect forwarding without rvalue references, it is going to be a bit more work.
Thanks, indeed. Although the amount of work is eased by using stuff like function_types and preprocessor stuff.
With polymorphic lambdas (an extension to C++0x lambdas), it is quite simpler:
apply_visitor([&](auto& f) { return f(a, b, c); }, m_funcs);
Polymorphic lambdas ... I guess you're talking C++1x here :-) Cheers, Rutger