
4 May
2011
4 May
'11
7:07 p.m.
On 05/04/2011 11:43 AM, lcaminiti wrote: [snip]
Can I do this without auto? Otherwise, the local Phoenix function retains its polymorphic behavior only on C++0x (but not on ISO C++) when it is given a name by assigning it to a local variable like local_add.
auto naturally makes it more convenient in many cases (and note that even with C++1x, phoenix retains the advantage of polymorphism over C++1x lambdas). However, in many cases a template function may take as a parameter an explicitly polymorphic function object, e.g. the various transformation functions of Boost.Fusion, or the visitor functions of Boost.Variant.