Subject: [Boost-bugs] [Boost C++ Libraries] #8775: fusion transform and fold not respecting const-ness of the sequence
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-03 21:14:48
#8775: fusion transform and fold not respecting const-ness of the sequence
-------------------------------------+---------------------
Reporter: eric_niebler | Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: fusion
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+---------------------
The following does not compile:
{{{
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/fusion/include/fold.hpp>
#include <boost/fusion/include/copy.hpp>
namespace fusion = boost::fusion;
struct F
{
typedef int result_type;
int operator()(int state, int & val) const
{
return state;
}
};
struct G
{
typedef int result_type;
int operator()(int & val) const
{
return val;
}
};
int main()
{
fusion::vector<int, int> v(1,2);
fusion::vector<int, int> v2;
// fold does not respect constness
fusion::fold(v, 42, F());
// transform does not respect constness
fusion::copy(fusion::transform(v, G()), v2);
}
}}}
In my opinion, it should.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8775> 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