FOREACH with only const_iterators?
Given that this is the user list and not the development list, it might be inappropriate to ask about the FOREACH library, since it hasn't gone into an official release yet. Feel free to point me to the development list. 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...) Thanks folks!! ---------------------------------------------------------------------- Dave Steffen, Ph.D. "The only justification for our concepts and Software Engineer IV systems of concepts is that they serve to Numerica Corporation represent the complex of our experiences; ph (970) 419-8343 x27 beyond this they have no legitimacy." fax (970) 223-6797 -- Albert Einstein dgsteffen@numerica.us
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
participants (2)
-
Dave Steffen
-
Eric Niebler