From 2643c33b2051c150a8f81f7604d5bcef48e7d12f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 1 Feb 2002 13:03:21 +0000 Subject: [PATCH] Doc fixes from Thomas Witt [SVN r12621] --- iterator_adaptors.htm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/iterator_adaptors.htm b/iterator_adaptors.htm index 06c022d..7dbb2f9 100644 --- a/iterator_adaptors.htm +++ b/iterator_adaptors.htm @@ -487,9 +487,15 @@ struct default_iterator_policies Requires: B is convertible to Base. - base_type base() const; + const base_type& base() const; +

+ Return a const reference to the base object. + + base_type& base();

- Return a copy of the base object. + Return a reference to the base object. This is to give the policies object + access to the base object. See above for policies + iterator_adaptor interaction.[8]

Example

@@ -760,7 +766,8 @@ struct iterator_adaptor iterator_adaptor(); explicit iterator_adaptor(const Base&, const Policies& = Policies()); - base_type base() const; + base_type& base(); + const base_type& base() const; template <class B, class V, class R, class P> iterator_adaptor( @@ -891,6 +898,10 @@ bool operator==(const iterator_adaptor<B1,P,V1,R1,P1,C,D>&, Base type is a const pointer, then the correct defaults for the reference and pointer types can not be deduced. You must specify these types explicitly. +

[8] + Exposing the base object might be considered as being dangerous. + A possible fix would require compiler support for template friends. + As this is not widely available today, the base object remains exposed for now.