Commit fd6c9be8 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] use a wrapper for boost::function to work around sunstudio build issue

it can't handle it if we pass a function object directly to asio function
(also templated).  okayed on jabber.
parent fc4e4e5c
......@@ -158,9 +158,22 @@ private:
asio::error_code ec_;
// The callback functor for internal asynchronous read event. This is
// stateless (and it will be copied in the ASIO library anyway), so
// can be const
const boost::function<void(const asio::error_code&, size_t)>
// can be const.
// SunStudio doesn't like a boost::function object to be passed, so
// we use the wrapper class as a workaround.
class CallbackWrapper {
CallbackWrapper(boost::function<void(const asio::error_code&, size_t)>
callback) :
void operator()(const asio::error_code& error, size_t len) {
callback_(error, len);
boost::function<void(const asio::error_code&, size_t)> callback_;
const CallbackWrapper recv_callback_;
// Auxiliary functions
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment