Subject: Re: [boost] [local] Help for the Alternatives section
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-05-04 15:27:07


On 04/05/2011 20:43, lcaminiti wrote:

> Can I do this without auto?

Not if you want to define the function object in a local scope.

> Otherwise, the local Phoenix function retains
> its polymorphic behavior only on C++0x (but not on ISO C++)

Note a lot of C++03 compilers provide typeof which is basically the same
thing, and it can be implemented on MSVC exploiting a bug.

So you can write
BOOST_AUTO(f, ref(sum) += factor * _1);

and it's pretty portable.

Actually, Boost.Phoenix uses Proto, which itself requires native support
of Boost.Typeof.