Return base by const&

[SVN r21775]
This commit is contained in:
Dave Abrahams
2004-01-15 19:06:25 +00:00
parent 7c784ad112
commit 1e3da4b77f
4 changed files with 18 additions and 23 deletions

View File

@ -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
-----------------------------------------------