Subject: [Boost-bugs] [Boost C++ Libraries] #7619: Compiler error with move and packaged_task
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-31 16:05:28
#7619: Compiler error with move and packaged_task
------------------------------------------------------+---------------------
Reporter: anonymous | Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: move
Version: Boost 1.51.0 | Severity: Regression
Keywords: move, packaged_task, futures, io_service |
------------------------------------------------------+---------------------
Consider the following simple code:
{{{
// mt_test.cpp
#include <boost/asio.hpp>
#include <boost/move/move.hpp>
#include <boost/thread.hpp>
int process_data()
{
return 1;
}
int main()
{
boost::asio::io_service io_service;
boost::asio::io_service::work work(io_service);
boost::packaged_task<int> task(boost::bind(&process_data));
io_service.post(boost::move(task));
}
}}}
This generates the errors (using gcc version 4.6.3 and boost 1.51.0)
{{{
g++ -I ./boost_1_51_0/ mt_test.cpp -o mt_test
In file included from ./boost_1_51_0/boost/asio/io_service.hpp:767:0,
from ./boost_1_51_0/boost/asio/basic_io_object.hpp:19,
from ./boost_1_51_0/boost/asio/basic_socket.hpp:19,
from
./boost_1_51_0/boost/asio/basic_datagram_socket.hpp:20,
from ./boost_1_51_0/boost/asio.hpp:20,
from mt_test.cpp:2:
./boost_1_51_0/boost/asio/impl/io_service.hpp: In member function âvoid
boost::asio::io_service::post(const CompletionHandler&) [with
CompletionHandler = boost::detail::thread_move_t<boost::packaged_task<int>
>]â:
mt_test.cpp:18:34: instantiated from here
./boost_1_51_0/boost/asio/impl/io_service.hpp:95:67: error: no match for
call to â(boost::detail::thread_move_t<boost::packaged_task<int> >) ()â
In file included from
./boost_1_51_0/boost/asio/detail/handler_invoke_helpers.hpp:21:0,
from
./boost_1_51_0/boost/asio/detail/bind_handler.hpp:20,
from
./boost_1_51_0/boost/asio/detail/wrapped_handler.hpp:18,
from ./boost_1_51_0/boost/asio/io_service.hpp:24,
from ./boost_1_51_0/boost/asio/basic_io_object.hpp:19,
from ./boost_1_51_0/boost/asio/basic_socket.hpp:19,
from
./boost_1_51_0/boost/asio/basic_datagram_socket.hpp:20,
from ./boost_1_51_0/boost/asio.hpp:20,
from mt_test.cpp:2:
./boost_1_51_0/boost/asio/handler_invoke_hook.hpp: In function âvoid
boost::asio::asio_handler_invoke(Function, ...) [with Function =
boost::detail::thread_move_t<boost::packaged_task<int> >]â:
./boost_1_51_0/boost/asio/detail/handler_invoke_helpers.hpp:39:3:
instantiated from âvoid
boost_asio_handler_invoke_helpers::invoke(Function&, Context&) [with
Function = boost::detail::thread_move_t<boost::packaged_task<int> >,
Context = boost::detail::thread_move_t<boost::packaged_task<int> >]â
./boost_1_51_0/boost/asio/detail/completion_handler.hpp:67:7:
instantiated from âstatic void
boost::asio::detail::completion_handler<Handler>::do_complete(boost::asio::detail::io_service_impl*,
boost::asio::detail::operation*, const boost::system::error_code&,
std::size_t) [with Handler =
boost::detail::thread_move_t<boost::packaged_task<int> >,
boost::asio::detail::io_service_impl =
boost::asio::detail::task_io_service, boost::asio::detail::operation =
boost::asio::detail::task_io_service_operation, std::size_t = long
unsigned int]â
./boost_1_51_0/boost/asio/detail/completion_handler.hpp:38:48:
instantiated from
âboost::asio::detail::completion_handler<Handler>::completion_handler(Handler&)
[with Handler = boost::detail::thread_move_t<boost::packaged_task<int> >]â
./boost_1_51_0/boost/asio/detail/impl/task_io_service.hpp:61:3:
instantiated from âvoid
boost::asio::detail::task_io_service::post(Handler) [with Handler =
boost::detail::thread_move_t<boost::packaged_task<int> >]â
./boost_1_51_0/boost/asio/impl/io_service.hpp:97:3: instantiated from
âvoid boost::asio::io_service::post(const CompletionHandler&) [with
CompletionHandler = boost::detail::thread_move_t<boost::packaged_task<int>
>]â
mt_test.cpp:18:34: instantiated from here
./boost_1_51_0/boost/asio/handler_invoke_hook.hpp:64:3: error: no match
for call to â(boost::detail::thread_move_t<boost::packaged_task<int> >)
()â
}}}
I thought this was solved in [https://svn.boost.org/trac/boost/ticket/4521
Ticket 4521]?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7619> 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:11 UTC