Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6278: mem_fn has a different result_type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-16 18:50:07
#6278: mem_fn has a different result_type
------------------------------------+---------------------------------------
Reporter: giecrilj@⦠| Owner: pdimov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: bind
Version: Boost 1.48.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------+---------------------------------------
Comment (by giecrilj@â¦):
If result_type were plain, as it ''allegedly'' is, and the type of the
member were noncopyable then returning it from a function would be a
problem.
Specific problem:
* you cannot copy into a `transform_iterator` when the transform selects
a reference to a member by means of `mem_fn`.
If I may digress a bit, I suppose that the reason why the standard does
not provide an analogue for `mem_fun_ref` for data members is that
accessing data members is discouraged in C++. Having come to that
conclusion, I added the necessary accessors to the underlying class and
used just `mem_fun_ref`, eradicating `mem_fn` completely.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6278#comment:3> 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:08 UTC