[phoenix] using dereference and increment operator

Hi all, the following piece of code compiled with boost 1.39: std::vector<double> u(11,1.0), w(11,3.0); std::vector<double>::const_iterator it=w.begin(); double value=(*ph::ref(it)++)(); But if i use the expression *ph::ref(it)++ as a functional in an algorithm, std::generate(u.begin(),u.end(),*phoenix::ref(it)++ ); the compilation fails with the following error:
c:\boost\boost_msvc_2008\include\boost-1_39\boost\fusion\container\vector\detail\vector_n.hpp(68) : error C2440: '<function-style-cast>' : cannot convert from 'const boost::phoenix::composite<EvalPolicy,EvalTuple>' to 'boost::fusion::vector_data1<Derived,T0>' 1> with 1> [ 1> EvalPolicy=boost::phoenix::post_increment_eval, 1> EvalTuple=boost::fusion::vector<boost::phoenix::reference<std::_Vector_const_iterator<double,std::allocator<double>>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_> 1> ] 1> and 1> [ 1> Derived=boost::fusion::vector1<boost::phoenix::reference<std::_Vector_const_iterator<double,std::allocator<double>>>>, 1> T0=boost::phoenix::reference<std::_Vector_const_iterator<double,std::allocator<double>>> 1> ] 1> No constructor could take the source type, or constructor overload resolution was ambiguous
I remember that the compilation was fine when using boost 1.38. ( I need to check this.) Here is the code that produces the errors: # include <algorithm> # include <vector> # include <boost/spirit/include/phoenix.hpp> using namespace boost; int main() { std::vector<double> u(11,1.0), w(11,3.0); std::vector<double>::const_iterator it=w.begin(); double value=(*phoenix::ref(it)++)(); it=w.begin(); std::generate(u.begin(),u.end(),*phoenix::ref(it)++ ); return 0; } With regards, Kim Tang

AMDG Kim Kuen Tang wrote:
Kim Kuen Tang schrieb:
I remember that the compilation was fine when using boost 1.38.
I did some further tests and it shows that the compilation failed when using msvc 2008.
Perhaps we can allocate the errors and send a message to microsoft?
Your code compiles fine for me with Visual Studio 2008 and the trunk. In Christ, Steven Watanabe
participants (2)
-
Kim Kuen Tang
-
Steven Watanabe