Re: [Boost-bugs] [Boost C++ Libraries] #8489: Unnecessary Definition of iterator_adaptor.hpp class Has Dangerous Return of Temporary Object

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8489: Unnecessary Definition of iterator_adaptor.hpp class Has Dangerous Return of Temporary Object
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-30 18:06:11


#8489: Unnecessary Definition of iterator_adaptor.hpp class Has Dangerous Return
of Temporary Object
----------------------------------------------------+-----------------------
  Reporter: Jeffrey D. Oldham <oldham@…> | Owner: jeffrey.hellrung
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: iterator
   Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------------+-----------------------

Comment (by james.hirschorn@…):

 I originally thought this was a bug too, but I do not believe it is.

 First of all, the dereference member function of iterator_adaptor does not
 need to be valid (it is clearly invalid in your specific example). You can
 simply redefine dereference in your iterator class which inherits from
 iterator_adaptor, and the one from the base class will be ignored by the
 compiler.

 Secondly, I supsect there may be a problem with the operator*() of your
 Base class. It is returning by value, but normally operator*() returns a
 reference.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8489#comment:6>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC