Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-25 08:22:43


----- Original Message -----
From: "Thomas Witt" <witt_at_[hidden]>

> >
http://www.boost.org/libs/utility/iterator_adaptors.htm#additional_members
>
> In case you refer to:
>
> base_type base() const;
> Return a copy of the base object.
>
> Unless I am missing something terrible obvious this is exactly the
problem.
> If the policies would use this member they would not work, as base() const
is
> documented to return a _copy_ of the base iterator and the policies work
by
> modifying the base iterator.

You're quite correct! Thanks for pointing that out. I can think of two
possibilities:

1. Just document that non-const base() is public
2. Make the Policies class a friend of the iterator, and document that
non-const base() is private, but available to policies.

Hmm, it seems you can't declare a template parameter to be a friend. I guess
it's #1. Jeremy, any thoughts?

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk