[phoenix] local_reference problems

AMDG The following code does not compile because phoenix tries to call the % operator with the types: boost::phoenix::detail::local_reference<boost::format> % int What is the rationale for local_reference? #include <boost/spirit/home/phoenix/operator.hpp> #include <boost/spirit/home/phoenix/core.hpp> #include <boost/spirit/home/phoenix/scope.hpp> #include <boost/format.hpp> #include <algorithm> #include <vector> using namespace boost::phoenix::arg_names; using namespace boost::phoenix::local_names; using namespace boost::phoenix; int main() { std::vector<int> values(10); std::for_each(values.begin(), values.end(), let(_f = boost::format("value is %d = %d\n")) [ std::cout << _f % _1 % _1 ] ); } C:\boost\trunk\boost/spirit/home/phoenix/operator/arithmetic.hpp(78) : error C2676: binary '%' : 'const boost::phoenix::detail::local_reference<T>' does not define this operator or a conversion to a type acceptable to the predefined operator with [ T=boost::basic_format<char> ] In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
The following code does not compile because phoenix tries to call the % operator with the types:
boost::phoenix::detail::local_reference<boost::format> % int
What is the rationale for local_reference?
None. For some reason, a version with some experimental tweaks crept in. It's quite possible that this is due to some Spirit coding streak. I'm not sure. Sorry about the confusion. I restored the original code without the local_reference. Submitted to trunk. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Steven Watanabe