Le 01/06/13 15:15, Szymon Gatner a écrit :



2013/6/1 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>

I don't find a constructor of function from a rvalue functor.

But I find an assignment

This seems confusing. What am I missing?


I don't have a standard but this is in sync what you describe:

http://en.cppreference.com/w/cpp/utility/functional/function/function

http://en.cppreference.com/w/cpp/utility/functional/function/operator%3D

confusing indeed.

Anyway, trying to:

#define BOOST_THREAD_VERSION 4

#include <boost/thread/future.hpp>
#include <functional>

int main()
{
  boost::packaged_task<void()> t;

  std::function<void()> f2;
  f2 = std::move(t);
}

gives exactly the same compilation error:



I get the same kind of error for gcc-4.8.0 and clang-3.2. I suspect that either we are missing something basic or there is a issue on the standard specification and the standard library implementors have not identified it while implementing these operations.

Best,
Vicente