Re: [boost] [fusion]bug: as_list on cons list is identity

Larry Evans <cppljevans@suddenlink.net> wrote: <snip exampling showing make list returns a cons cell list, rather than fusion::list>
IOW, instead of:
boost::fusion::vector<...>
there should be:
boost::fusion::list<...>
as the 1st line of the above result type for as_list<source_type>::type.
Does this lead to a problem in your code? The sequence of cons cells is a list (fusion::list can be seen as just a convenient way of building a long cons cell sequence). The cons sequence will behave exactly as a list. Maybe these functions should be called as_random_access_sequence, as_bidirectional_sequence etc? Possibly that would be less misleading? Cheers Dan ___________________________________________________________ Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/

On 02/06/08 01:21, dan marsden wrote:
Larry Evans <cppljevans@suddenlink.net> wrote:
<snip exampling showing make list returns a cons cell list, rather than fusion::list>
IOW, instead of:
boost::fusion::vector<...>
there should be:
boost::fusion::list<...>
as the 1st line of the above result type for as_list<source_type>::type.
Does this lead to a problem in your code? The sequence of cons cells is a list (fusion::list can be seen as just a convenient way of building a long cons cell sequence). The cons sequence will behave exactly as a list. Maybe these functions should be called as_random_access_sequence, as_bidirectional_sequence etc? Possibly that would be less misleading?
Thanks dan, you're right, it doesn't make a difference, as I just found out. It appears the original problem was using mpl::filter_view then mpl::transform on that result, and this lead to a wrong result. I'd jumped to the conclusion that the problem was the fusion cons list, but my recent test results indicate that the problem is in mpl::filter_view.

On 02/06/08 08:59, Larry Evans wrote:
On 02/06/08 01:21, dan marsden wrote:
Larry Evans <cppljevans@suddenlink.net> wrote: [snip]
Does this lead to a problem in your code? The sequence of cons cells is a list (fusion::list can be seen as just a convenient way of building a long cons cell sequence). [snip]
Thanks dan, you're right, it doesn't make a difference, as I just found out.
It appears the original problem was using mpl::filter_view then mpl::transform on that result, and this lead to a wrong result. I'd jumped to the conclusion that the problem was the fusion cons list, but my recent test results indicate that the problem is in mpl::filter_view. Nope, I was wrong again. Although the printout of the transform appears different from:
mpl::vector<T0,T1,Tn> it behaves the same w.r.t. mpl::for_each. Lesson: Don't rely on typename printout's to compare equality of types. Use mpl::equal.
participants (2)
-
dan marsden
-
Larry Evans