|
Boost Users : |
Subject: Re: [Boost-users] [forEach] Working with custom operator []
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-05-09 08:49:25
Den 09-05-2011 14:26, Jeff Flinn skrev:
> Nathan Ridge wrote:
>> If you want your container to work with BOOST_FOREACH, you need
>> to make sure it has begin() and end() member functions which
>> return iterators with the appropriate capabilities (increment,
>> dereference, equality comparison).
>
> Or specialized boost::begin/boost::end perhaps?
No ... overload range_begin()/range_end() in the namespace of the class.
See the range docs.
-Thorsten
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net