Note that there are some explanatory texts on larger screens.

plurals
  1. POboost::bind together with boost::asio. boost::bind follow up
    text
    copied!<p>Now I'd like to add two parameters to the function of the former question: <a href="https://stackoverflow.com/questions/12364625/boostbind-together-with-boostasio-boostbind-not-working-copied-from-an-e">boost::bind together with boost::asio. boost::bind not working, copied from an example</a> </p> <p><strong>EDIT:</strong> Sorry, forgot to add the type of timer_result: boost::optional timer_result;</p> <pre><code>//my function void CClient::setResult2(boost::optional&lt;boost::system::error_code&gt;* a, boost::system::error_code b, const boost::system::error_code&amp; error, std::size_t); //my attempt: I'd like to set the value of the first, third and fourth parameters but not the second one timer.async_wait(boost::bind(&amp;CClient::setResult2, this, &amp;timer_result, _1,boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); </code></pre> <p>Does the _1 mean something different from the last question? Thanks.</p> <p><strong>Errors:</strong></p> <pre><code>Description Resource Path Location Type required from ‘void boost::asio::basic_deadline_timer&lt;Time, TimeTraits, TimerService&gt;::async_wait(WaitHandler&amp;&amp;) [with WaitHandler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;; Time = boost::posix_time::ptime; TimeTraits = boost::asio::time_traits&lt;boost::posix_time::ptime&gt;; TimerService = boost::asio::deadline_timer_service&lt;boost::posix_time::ptime, boost::asio::time_traits&lt;boost::posix_time::ptime&gt; &gt;]’ remote_server line 501, external location: /usr/include/boost/asio/basic_deadline_timer.hpp C/C++ Problem invalid user-defined conversion from ‘const boost::system::error_code’ to ‘unsigned int’ [-fpermissive] remote_server line 525, external location: /usr/include/boost/bind/bind.hpp C/C++ Problem required from ‘void boost::_bi::list5&lt;A1, A2, A3, A4, A5&gt;::operator()(boost::_bi::type&lt;void&gt;, F&amp;, A&amp;, int) [with F = boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;; A = boost::_bi::list1&lt;const boost::system::error_code&amp;&gt;; A1 = boost::_bi::value&lt;CClient*&gt;; A2 = boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;; A3 = boost::arg&lt;1&gt;; A4 = boost::arg&lt;1&gt; (*)(); A5 = boost::arg&lt;2&gt; (*)()]’ remote_server line 525, external location: /usr/include/boost/bind/bind.hpp C/C++ Problem size of array is negative remote_server line 37, external location: /usr/include/boost/bind/arg.hpp C/C++ Problem make: *** [src/CClient.o] Error 1 remote_server C/C++ Problem required from ‘void boost::asio::detail::binder1&lt;Handler, Arg1&gt;::operator()() [with Handler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;; Arg1 = boost::system::error_code]’ remote_server line 46, external location: /usr/include/boost/asio/detail/bind_handler.hpp C/C++ Problem required from ‘boost::_bi::bind_t&lt;R, F, L&gt;::result_type boost::_bi::bind_t&lt;R, F, L&gt;::operator()(const A1&amp;) [with A1 = boost::system::error_code; R = void; F = boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;; L = boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt;; boost::_bi::bind_t&lt;R, F, L&gt;::result_type = void]’ remote_server line 47, external location: /usr/include/boost/bind/bind_template.hpp C/C++ Problem required from ‘void boost_asio_handler_invoke_helpers::invoke(Function&amp;, Context&amp;) [with Function = boost::asio::detail::binder1&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;, boost::system::error_code&gt;; Context = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;]’ remote_server line 39, external location: /usr/include/boost/asio/detail/handler_invoke_helpers.hpp C/C++ Problem required from ‘void boost::asio::asio_handler_invoke(Function, ...) [with Function = boost::asio::detail::binder1&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;, boost::system::error_code&gt;]’ remote_server line 64, external location: /usr/include/boost/asio/handler_invoke_hook.hpp C/C++ Problem required from ‘boost::asio::detail::wait_handler&lt;Handler&gt;::wait_handler(Handler&amp;) [with Handler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;]’ remote_server line 39, external location: /usr/include/boost/asio/detail/wait_handler.hpp C/C++ Problem required from ‘static void boost::asio::detail::wait_handler&lt;Handler&gt;::do_complete(boost::asio::detail::io_service_impl*, boost::asio::detail::operation*, const boost::system::error_code&amp;, std::size_t) [with Handler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;; 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 = unsigned int]’ remote_server line 69, external location: /usr/include/boost/asio/detail/wait_handler.hpp C/C++ Problem make: *** No rule to make target `all'. C/C++ Problem required from ‘void boost::asio::deadline_timer_service&lt;TimeType, TimeTraits&gt;::async_wait(boost::asio::deadline_timer_service&lt;TimeType, TimeTraits&gt;::implementation_type&amp;, WaitHandler&amp;&amp;) [with WaitHandler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;; TimeType = boost::posix_time::ptime; TimeTraits = boost::asio::time_traits&lt;boost::posix_time::ptime&gt;; boost::asio::deadline_timer_service&lt;TimeType, TimeTraits&gt;::implementation_type = boost::asio::detail::deadline_timer_service&lt;boost::asio::time_traits&lt;boost::posix_time::ptime&gt; &gt;::implementation_type]’ remote_server line 138, external location: /usr/include/boost/asio/deadline_timer_service.hpp C/C++ Problem required from ‘void boost::asio::detail::deadline_timer_service&lt;Time_Traits&gt;::async_wait(boost::asio::detail::deadline_timer_service&lt;Time_Traits&gt;::implementation_type&amp;, Handler) [with Handler = boost::_bi::bind_t&lt;void, boost::_mfi::mf4&lt;void, CClient, boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code, const boost::system::error_code&amp;, unsigned int&gt;, boost::_bi::list5&lt;boost::_bi::value&lt;CClient*&gt;, boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt;, boost::arg&lt;1&gt; (*)(), boost::arg&lt;2&gt; (*)()&gt; &gt;; Time_Traits = boost::asio::time_traits&lt;boost::posix_time::ptime&gt;]’ remote_server line 180, external location: /usr/include/boost/asio/detail/deadline_timer_service.hpp C/C++ Problem required from here CClient.cpp /remote_server/src line 102 C/C++ Problem </code></pre> <p><strong>Infos:</strong></p> <pre><code>Description Resource Path Location Type candidate is: boost::system::error_code::operator boost::system::error_code::unspecified_bool_type() const &lt;near match&gt; remote_server line 355, external location: /usr/include/boost/system/error_code.hpp C/C++ Problem no known conversion for implicit ‘this’ parameter from ‘boost::system::error_code::unspecified_bool_type {aka void (*)()}’ to ‘unsigned int’ remote_server line 355, external location: /usr/include/boost/system/error_code.hpp C/C++ Problem </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload