From 1e3da4b77f527437b018262616dadb0e2ebf6390 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 15 Jan 2004 19:06:25 +0000 Subject: [PATCH] Return base by const& [SVN r21775] --- doc/facade-and-adaptor.html | 16 ++++++---------- doc/iterator_adaptor.html | 9 ++++++--- doc/iterator_adaptor_ref.rst | 8 ++++++-- doc/iterator_facade.html | 8 -------- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index f91c8a7..b55fbc5 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -742,14 +742,6 @@ traversal tags would add no information]

-

If CategoryOrTraversal is use_default then -iterator_traversal<Derived>::type is convertible to the most -derived standard traversal tag type to which -iterator_traversal<Iterator>::type is also convertible, and not to -any more-derived traversal tag type. Otherwise -iterator_traversal<Derived>::type is convertible to the most -derived standard traversal tag type to which CategoryOrTraversal -is also convertible, and not to any more-derived traversal tag type.

The enable_if_interoperable template used above is for exposition purposes. The member operators should be only be in an overload set provided the derived types Dr1 and Dr2 are interoperable, @@ -1173,7 +1165,7 @@ class iterator_adaptor public: iterator_adaptor(); explicit iterator_adaptor(Base iter); - Base base() const; + Base const base() const; protected: Base const& base_reference() const; Base& base_reference(); @@ -1270,7 +1262,7 @@ expression involving Derived i -

Base base() const;

+

Base const base() const;

@@ -1279,6 +1271,10 @@ expression involving Derived i
+

[Note: specifying Base const gives implementations license to +return Base const& for efficiency's sake. If base() +returned just Base, it would be possible to call non-const +member functions on the result object directly]

iterator_adaptor protected member functions

diff --git a/doc/iterator_adaptor.html b/doc/iterator_adaptor.html index 62e516a..020a4ba 100644 --- a/doc/iterator_adaptor.html +++ b/doc/iterator_adaptor.html @@ -133,7 +133,7 @@ class iterator_adaptor public: iterator_adaptor(); explicit iterator_adaptor(Base iter); - Base base() const; + Base const base() const; protected: Base const& base_reference() const; Base& base_reference(); @@ -229,7 +229,7 @@ expression involving Derived i -

Base base() const;

+

Base const base() const;

@@ -238,6 +238,10 @@ expression involving Derived i
+

[Note: specifying Base const gives implementations license to +return Base const& for efficiency's sake. If base() +returned just Base, it would be possible to call non-const +member functions on the result object directly]

iterator_adaptor protected member functions

@@ -440,7 +444,6 @@ adaptor, and also diff --git a/doc/iterator_adaptor_ref.rst b/doc/iterator_adaptor_ref.rst index ece0684..cc643d3 100644 --- a/doc/iterator_adaptor_ref.rst +++ b/doc/iterator_adaptor_ref.rst @@ -21,7 +21,7 @@ public: iterator_adaptor(); explicit iterator_adaptor(Base iter); - Base base() const; + Base const base() const; protected: Base const& base_reference() const; Base& base_reference(); @@ -122,10 +122,14 @@ expression involving ``Derived`` in those concepts' requirements. :Returns: An instance of ``iterator_adaptor`` with ``m_iterator`` copy constructed from ``iter``. -``Base base() const;`` +``Base const base() const;`` :Returns: ``m_iterator`` +[Note: specifying ``Base const`` gives implementations license to +return ``Base const&`` for efficiency's sake. If ``base()`` +returned just ``Base``, it would be possible to call non-``const`` +member functions on the result object directly] ``iterator_adaptor`` protected member functions ----------------------------------------------- diff --git a/doc/iterator_facade.html b/doc/iterator_facade.html index df4c831..d607f4d 100644 --- a/doc/iterator_facade.html +++ b/doc/iterator_facade.html @@ -407,14 +407,6 @@ traversal tags would add no information]

-

If CategoryOrTraversal is use_default then -iterator_traversal<Derived>::type is convertible to the most -derived standard traversal tag type to which -iterator_traversal<Iterator>::type is also convertible, and not to -any more-derived traversal tag type. Otherwise -iterator_traversal<Derived>::type is convertible to the most -derived standard traversal tag type to which CategoryOrTraversal -is also convertible, and not to any more-derived traversal tag type.

The enable_if_interoperable template used above is for exposition purposes. The member operators should be only be in an overload set provided the derived types Dr1 and Dr2 are interoperable,