2

The following code is a snippet that illustrates the problem:

#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/fusion/functional.hpp>
#include <boost/fusion/container.hpp>

using IntFunc = boost::function<void(int, int)>;
using IntArgs = boost::fusion::vector<int, int>;

void HandleInt(const IntArgs& args)
{
}

void UnfusedTest()
{
  auto f = boost::fusion::make_unfused(boost::bind(&HandleInt, _1));
  IntFunc func = f;
}

When compiled using boost 1.61 it fails with

cannot convert argument 1 from 'int' to 'int &'" error.

I need to return a function object that can be called like this: func(1, 2);

What is wrong and what can I do to fix it?

Thanks!

o-90
  • 17,045
  • 10
  • 39
  • 63
Vik
  • 21
  • 1

0 Answers0