Note that there are some explanatory texts on larger screens.

plurals
  1. POboost::bind together with boost::asio. boost::bind not working, copied from an example
    primarykey
    data
    text
    <p>Could someone tell me why this does not compile? I basically copied it from an example by Kholkoff (<a href="http://lists.boost.org/Archives/boost/2007/04/120339.php" rel="nofollow noreferrer">http://lists.boost.org/Archives/boost/2007/04/120339.php</a>), back in 2007, about reads() in sockets with timeouts:</p> <pre><code>void CClient::setResult(boost::optional&lt;boost::system::error_code&gt;* a,boost::system::error_code b) { *a = b; } </code></pre> <p>I'm binding() it like this:</p> <pre><code>timer.async_wait(boost::bind(&amp;CClient::setResult, &amp;timer_result, _1)); </code></pre> <p>The errors that gcc prints are unreadable to me:</p> <pre><code>static assertion failed: WaitHandler type requirements not met remote_server line 499, external location: /usr/include/boost/asio/basic_deadline_timer.hpp C/C++ Problem no match for call to ‘(boost::_bi::bind_t&lt;boost::_bi::unspecified, void (CClient::*)(boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code), boost::_bi::list2&lt;boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt; &gt; &gt;) (const boost::system::error_code&amp;)’ remote_server line 499, external location: /usr/include/boost/asio/basic_deadline_timer.hpp C/C++ Problem ‘void (CClient::*)(boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code)’ is not a class, struct, or union type remote_server line 69, external location: /usr/include/boost/bind/bind.hpp C/C++ Problem make: *** No rule to make target `all'. C/C++ Problem make: *** [src/CClient.o] Error 1 remote_server C/C++ Problem required from ‘class boost::_bi::bind_t&lt;boost::_bi::unspecified, void (CClient::*)(boost::optional&lt;boost::system::error_code&gt;*, boost::system::error_code), boost::_bi::list2&lt;boost::_bi::value&lt;boost::optional&lt;boost::system::error_code&gt;*&gt;, boost::arg&lt;1&gt; &gt; &gt;’ remote_server line 15, external location: /usr/include/boost/bind/bind_template.hpp C/C++ Problem required from here CClient.cpp /remote_server/src line 93 C/C++ Problem </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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