Re: [foreach] reverse foreach?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [foreach] reverse foreach?

gruenedd
"Shunsuke Sogame"  wrote:
> I hear the new range library is under construction, which will enable:
> BOOST_FOREACH (int x, vect|reversed)

"David Abrahams" wrote:
> I suggest you just make a nice reverse adaptor that models Range.
> BOOST_FOREACH( whatever, reverse_view( the_sequence ) )

I feel that it would be valuable to have an up-to-date statement
about this ("best practises"?) inside the foreach documentation,
since this might be one of the questions which appear more than
once if BOOST_FOREACH will be released.

David.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [foreach] reverse foreach?

Eric Niebler
[hidden email] wrote:

> "Shunsuke Sogame"  wrote:
>> I hear the new range library is under construction, which will enable:
>> BOOST_FOREACH (int x, vect|reversed)
>
> "David Abrahams" wrote:
>> I suggest you just make a nice reverse adaptor that models Range.
>> BOOST_FOREACH( whatever, reverse_view( the_sequence ) )
>
> I feel that it would be valuable to have an up-to-date statement
> about this ("best practises"?) inside the foreach documentation,
> since this might be one of the questions which appear more than
> once if BOOST_FOREACH will be released.


Yes, this question has come up several times. I'll add something to the
docs.

--
Eric Niebler
Boost Consulting
www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost