|
Boost : |
From: William Kempf (sirwillard_at_[hidden])
Date: 2000-11-20 16:41:01
--- In boost_at_[hidden], Douglas Gregor <gregod_at_r...> wrote:
> On Mon, 20 Nov 2000 19:15:42 -0000
> "William Kempf" <sirwillard_at_m...> wrote:
> [snip]
> > > This will change somewhat, because callback should really
inherit
> > from a callback_impl which is specialized based on the number of
> > parameters (just like function_callback_impl in
> > details/callback.hpp). Otherwise, we have extranneous, unusable
> > operator() overloads in the main callback class.
> >
> > The extraneous operator() overloads will never be instantiated
and so
> > never effect code size. I don't think there's a good reason for
> > deriving callback from callback_impl.
>
> The extra operator() overloads confuse the interface, though, and
have no meaning.
Remove all of them in favor of the inherited interface from the
detail class and you make things worse, though. The "public"
interface now has no documentation about the operator() at all.
Instead, you must look at one of several detail classes to figure it
out. I don't think this a compelling reason to do this.
> If a user attempts to pass an incorrect number of arguments to
operator(), we'd prefer to have the error show up in the callback
class instead of in one of the implementation classes from
boost::detail.
I don't see how inheritance makes this possible.
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk