As you correctly noticed, the async_wait method accepts a handler function that takes one parameter (const boost :: system :: error_code &). But in the Timer.4 example, the async_wait call is passed through boost bind as follows:
timer_.async_wait(boost::bind(&printer::print, this));
The boost :: bind function returns a function object that refers to the printing method for the class printer for the object that it refers to. This function object is called by the async_wait method with an error parameter (since this is the signature that it expects). But the error parameter is silently ignored because the binding does not refer to it.
The official boost :: bind publication contains more information about boost :: bind. See also the article How the Bost Bind library can improve your C ++ programs (there are probably many more articles, but I found this very useful).
Yukiko
source share