Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-05-09 11:03:16


On 05/06/2006 05:11 PM, dan marsden wrote:
> Larry Evans wrote:
[snip]
>>Also, since the above code is all for a specific structure, i.e.
>>example_struct, why is there any need for including a Struct
>>template parameter. Why not just:
>>
>> template<int Pos>
>> struct example_struct_iterator
>> : iterator_base<example_struct_iterator<example_struct, Pos> >
>> {
>> BOOST_STATIC_ASSERT(Pos >=0 && Pos < 3);
>> typedef example_struct struct_type;
>> ...
>> };
>
>
> The Struct parameter allows us to capture whether the iterator points into
> an example_struct or a const example_struct. Some of the rest of the example
> code needs to make this distinction.
OK, now I see. Thanks.
>
> Thanks for the feedback

Sure. And thanks for the fusion_v2 and the quick response to feedback.

However, I've got another question. I removed the value_of_impl from my
code since it looks like deref_impl defines what's needed and
my code ran OK. Is value_of_impl really needed to define a
fusion iterator for a new struct?


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