Boost logo

Boost Users :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-05-06 00:10:12


Dave Steffen wrote:
>
> My question is fairly simple: I have a container that only provides
> const_iterators; it's effectively "read-only" except to a small,
> select group of classes.
>
> Is there a way to tell the BOOST_FOREACH macro to use const_iterator
> instead of iterator?
>
> (Not a huge thing - I can add iterators to the class, or I can teach
> FOREACH how to iterate over it as described in the docs. I'm just
> wondering if I'm missing something...)
>

You're not missing anything. Those would be my two suggestions, in that
order.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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