iterator_adaptors Comment
There is a comment in iterator_adaptors: public: // implementation details (too many compilers have trouble when these are private). Policies& policies() { return m_iter_p.second(); } const Policies& policies() const { return m_iter_p.second(); } Base& iter() { return m_iter_p.first(); } const Base& iter() const { return m_iter_p.first(); } This seems to imply that iter() and policies() ought to be private. I would like to suggest that having access to the underlying iterator is valuable. This is especially true of transform and projection iterators which allow you to locate a record by searching on a field. Access to the underlying iterator gets access to the rest of the record. Is there some other way of accomplishing the same thing without using iter()? Thanks, ...Duane
--- In Boost-Users@y..., Duane Murphy
There is a comment in iterator_adaptors:
public: // implementation details (too many compilers have trouble when these are private). Policies& policies() { return m_iter_p.second(); } const Policies& policies() const { return m_iter_p.second(); }
Base& iter() { return m_iter_p.first(); } const Base& iter() const { return m_iter_p.first(); }
This seems to imply that iter() and policies() ought to be private.
This looks like an old version of the code. In the current release the function to access the base object is in the public interface and called "base()", not "iter()" -dave
--- At Mon, 14 Jan 2002 03:51:13 +0000, dave_abrahams wrote:
--- In Boost-Users@y..., Duane Murphy
wrote: There is a comment in iterator_adaptors:
public: // implementation details (too many compilers have trouble when these are private). Policies& policies() { return m_iter_p.second(); } const Policies& policies() const { return m_iter_p.second(); }
Base& iter() { return m_iter_p.first(); } const Base& iter() const { return m_iter_p.first(); }
This seems to imply that iter() and policies() ought to be private.
This looks like an old version of the code. In the current release the function to access the base object is in the public interface and called "base()", not "iter()"
Thank you. I over looked that one. That's what I was looking for. I'll change my code accordingly. ...Duane
participants (2)
-
dave_abrahams
-
Duane Murphy