On Wed, Jul 22, 2009 at 9:29 AM, Zachary Turner
template<class Handler> void intercept_handler(Handler real_handler, boost::system::error_code ec, size_t bytes_transferred) { //do whatever is necessary and then call the real handler.
real_handler(ec, bytes_transferred); }
What you're doing should work in principle, what errors are you getting? By the way, have you considered using boost::function for the callbacks? That way you could do all this without templates, so you can hide the implementation in a cpp file. Also, the type of the parameters of the callback would be fixed and the compiler will give you (and users) better error messages. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode