Hi,
Now I am trying to perform transform which mutates:
------
#include
#include
#include
#include
namespace fusion=boost::fusion;
struct C {};
struct B {
C make_c() { return C(); }
};
struct make_c {
template<typename Sig> struct result;
template <typename T>
struct result
{
typedef C type;
};
template <typename T>
struct result
{
typedef C type;
};
template <typename T>
C
operator()(T& t) const { return t.make_c(); }
};
int
main()
{
B b1, b2;
auto z1 = fusion::make_list( b1, b2 );
auto z2 = fusion::as_list( fusion::transform( z1, make_c() ) );
return 0;
}
----
Both gcc and msvc complain like this:
test.cpp:29:46: error: passing ‘const B’ as ‘this’ argument of ‘C B::make_c()’
discards qualifiers.
What am I missing now?
Gennadiy