Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4427: for_each does not take a non-const Function object
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-13 23:56:40
#4427: for_each does not take a non-const Function object
--------------------------------+-------------------------------------------
Reporter: chetant@⦠| Owner: djowel
Type: Bugs | Status: reopened
Milestone: Boost 1.44.0 | Component: fusion
Version: Boost 1.43.0 | Severity: Problem
Resolution: | Keywords: for_each
--------------------------------+-------------------------------------------
Comment (by djowel):
And indeed my comments were all bogus. Please ignore. I realize now that
this is about adding a non-const overload for function object, not the
sequence (which has been there for a long time now).
So, indeed it still stands as -not-a-bug-. See the documentation:
http://tinyurl.com/7uxyovh
It is clear there that you can't expect F to be mutable. F can be passed
around by value and any changes there will not update the actual F you
passed in. Even STL algorithms are designed that way, so I am not sure why
you are surprised (e.g.
http://en.cppreference.com/w/cpp/algorithm/for_each; notice UnaryFunction
f)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4427#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:09 UTC