Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-03-12 18:19:43


On 03/12/08 14:40, Larry Evans wrote:
[snip]
>
> I'm afraid I was wrong. here's what I get as the transform output with
> my type_name_print:
>
> test_product
> boost::mpl::cross_product_view
> < boost::mpl::range_c
> < int
> , 0
> , 3
> >
> , boost::mpl::range_c
> < int
> , 100
> , 104
> >
> >
>
> where the function producing this is:
>
> typedef mpl::range_c<int,0,3> seq0;
> typedef mpl::range_c<int,100,104> seq1;
>
> void test_product(void)
> {
> std::cout<<"test_product\n";
> typedef mpl::cross_product_view<seq0,seq1> type;
> #ifdef TYPE_TREE_PRINT
> ::utility::type_name_print<type>();
> #else
> type::print_each();
> #endif
> }
>
> and with #define TYPE_TREE_PRINT. Which I expected to see was something
> contains pair's of mpl::integral_c<int,I>.

I maybe wrong about being wrong. I think the reason the above printout
fooled me is because the cross_product_view is lazy. The only
way to show it's a nested structure is with the nested for_each or
maybe mpl::equal comparing it to a handcoded solution like
watanabesj_at_[hidden] posted recently.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk