Boost logo

Boost :

From: Steven Kirk (steven.kirk_at_[hidden])
Date: 2002-07-19 10:15:08


I think that providing multiple ways to achieve the same thing in
boost::function is likely to be far more confusing to people encountering
boost::function for the first time... It doesn't look right somehow - if I
see a "boost::function<void, char const*, int>" I immediately identify it as
a templatized object, it looks familiar. "function< void (*) (char const *
name, int mode) >" looks like nothing I've ever seen before, and if I was
browsing the code I it'd confuse me more.

As for being able to specify the param names, yes that is a definite
advantage, but like you say still no replacement for good documentation.

I guess what I'm saying is KISS.

> From: "Giovanni Bajo" <giovannibajo_at_[hidden]>
> > From: "Peter Dimov" <pdimov_at_[hidden]>
> >
> > > Do you think that it might be a good idea to allow boost::function's
> > > declared as:
> > >
> > > function< void (*) (char const * name, int mode) > pf;
> > >
> > > ?
> >
> > Is there any specific reason to support such a syntax? function<void,
char
> > const*, int> seems good enough to me.
>
> It's good enough, when you know that the return type is the first in the
> list, and you don't need the parameter names.
>
> function< void, char const * /*name*/, int /*mode*/ > is acceptable, but
the
> above is still clearer for people that encounter function<> for the first
> time. You can always use
>
> function<void, char const *, int> pf; // void pf(char const * name, int
> mode)
>
> of course. :-)
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk