c++ - Boost binding error in completion handler -


i encountered binding error

/usr/local/include/boost/bind/bind.hpp:457: error: invalid use of void expression

my program asynchronous action using callback handler following:

template<typename handler> void async_monitor(handler handler) {     stream_descriptor_.async_read_some(             boost::asio::buffer(read_buffer_),             boost::bind(&dir_monitor_impl::handle_monitor<handler>, shared_from_this(),                     boost::asio::placeholders::error,                     boost::asio::placeholders::bytes_transferred,                     handler)); }//if remove code, compilation success 

and handler declaration:

template<typename handler> void handle_monitor(boost::system::error_code &ec,         std::size_t bytes_transferred, handler handler){ } 

finally, these asychronous action used follwowing:

template <typename handler>  void start_async_monitor(implementation_type &impl, handler handler)  {      //this->async_monitor_io_service_.post(monitor_operation<handler>(impl, this->get_io_service(), handler));     impl->async_monitor(handler); } 

could guys me explain error, much!

the handler signature must following (pay attention const):

void handle_monitor(const boost::system::error_code &ec, std::size_t bytes_transferred, handler handler)


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -