I found a very good explanation here: http://blog.think-async.com/2010/04/bind-illustrated.html

On Tue, Dec 20, 2011 at 12:07 AM, Igor R <boost.lists@gmail.com> wrote:
> It is specified in http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/reference/AcceptHandler.html
> that a handler for `async_accept()` must satisfy the following function
> signature:
>
>     void accept_handler(
>         const boost::system::error_code& ec)
>     {
>       ...
>     }
>
> However, in the `Daytime.3` example, using boost::bind, the handler can be
> specified as much parameter as desired, as long as it does not exceed the
> limit of `boost::bind` (which is 9 arguments at maximum):
<...>
> Why is that possible? I thought even with `boost::bind`, the exact function
> signature still has to be matched.


It is possible, because bind creates a functor that exposes operator()
having the number of arguments that matches the expectations of the
completion handler caller.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users