Gents,
For illustration purposes I created the following code that iterates through a sequence and accumulates the distances between the current iterator and the beginning of the sequence. Somehow this code works for normal ranges (range1 and range2) but fails to compile for joint_view range3 (80-plus errors). Changing the call to distance to compare between begin and end or between _2 and _2 (self) works. I am at a loss here. Can someone point out what I am doing wrong?
Thanks
Ben
#include <iostream>
#include
::type type; };
int main( int argc, char* argv[] ) { typedef mpl::range_c< char, 'a', 'd' >::type range1; typedef mpl::range_c< char, 'm', 'q' >::type range2; typedef mpl::joint_view< range1, range2 >::type range3; typedef distances< range3 >::type type1; std::cout << type1(); std::cout << std::endl; return 0; } This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Ben,
For illustration purposes I created the following code that iterates through a sequence and accumulates the distances between the current iterator and the beginning of the sequence. Somehow this code works for normal ranges (range1 and range2) but fails to compile for joint_view range3 (80-plus errors). Changing the call to distance to compare between begin and end or between _2 and _2 (self) works. I am at a loss here. Can someone point out what I am doing wrong?
Your code is perfectly okay, the failure is due to a bug in the library (fixed in the CVS, http://boost.cvs.sourceforge.net/boost/boost/boost/mpl/aux_/lambda_spec.hpp?r1=1.8&r2=1.9). Thanks for the report, -- Aleksey Gurtovoy MetaCommunications Engineering
participants (2)
-
Aleksey Gurtovoy
-
Küppers, Ben