Make HandlerCall operator() const

This commit is contained in:
Vinnie Falco
2013-08-18 16:50:16 -07:00
parent 0df51dc9e4
commit dd3ac6a154
4 changed files with 8 additions and 8 deletions

View File

@@ -259,17 +259,17 @@ HandlerCall const& HandlerCall::endComposed () const noexcept
return *this;
}
void HandlerCall::operator() ()
void HandlerCall::operator() () const
{
(*m_call)();
}
void HandlerCall::operator() (error_code const& ec)
void HandlerCall::operator() (error_code const& ec) const
{
(*m_call)(ec);
}
void HandlerCall::operator() (error_code const& ec, std::size_t bytes_transferred)
void HandlerCall::operator() (error_code const& ec, std::size_t bytes_transferred) const
{
(*m_call)(ec, bytes_transferred);
}

View File

@@ -397,9 +397,9 @@ public:
error at run-time.
*/
/** @{ */
void operator() ();
void operator() (error_code const& ec);
void operator() (error_code const& ec, std::size_t bytes_transferred);
void operator() () const;
void operator() (error_code const& ec) const;
void operator() (error_code const& ec, std::size_t bytes_transferred) const;
/** @} */
//--------------------------------------------------------------------------

View File

@@ -152,7 +152,7 @@ boost::system::error_code Socket::handshake (handshake_type, boost::system::erro
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(HandlerCall, void (boost::system::error_code))
Socket::async_handshake (handshake_type, BOOST_ASIO_MOVE_ARG(HandlerCall) handler)
Socket::async_handshake (handshake_type, HandlerCall const& handler)
{
#if BEAST_ASIO_HAS_FUTURE_RETURNS
boost::asio::detail::async_result_init<

View File

@@ -699,7 +699,7 @@ public:
}
BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(HandlerCall, void (error_code))
async_shutdown (BOOST_ASIO_MOVE_ARG(HandlerCall) handler,
async_shutdown (HandlerCall const& handler,
boost::true_type)
{
return m_object.async_shutdown (handler);