|
Boost Users : |
Subject: Re: [Boost-users] multiple levels of bind nesting
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-07-22 13:41:28
On Wed, Jul 22, 2009 at 9:29 AM, Zachary Turner<divisortheory_at_[hidden]> wrote:
> 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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net