|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-09-22 21:00:18
From: "Douglas Gregor" <gregod_at_[hidden]>
> On Sunday 22 September 2002 01:45 pm, David Abrahams wrote:
> > I've just been preparing class materials on Boost.Function, and it
occurred
> > to me that the use of the term "compatible" in the documentation could
be
> > confusing. On the one hand, it's used to describe which functions and
> > function objects can be implicitly converted to function<T> objects (I
like
> > this one). On the other hand, it's used to describe the old syntax
> > functionNN<result, arg1, arg2,... argNN> (I don't like this one). Could
we
> > try something else, like "portable" for the second usage?
>
> When I picked over the Function documentation again for the proposal, I
used
> the term 'callable' for the first usage of compatible. A function object
of
> type F can be implicitly converted to a function<R (T1, T2, ..., TN)>
object
> if F is Callable with argument types T1, T2, ...., TN and return type R.
I
> think this is more clear than 'compatible' (and the concept is reusable
as a
> superior of UnaryFunction/BinaryFunction/etc).
>
> I don't particularly like 'portable' for the second usage, because it
makes
> the preferred syntax sound like it isn't C++.
I thought of that, too :(
> But I'll use it if it helps avoid confusion.
As long as you have two different terms, I'm sure it doesn't matter.
However, "callable" is harder to use than "compatible" when describing the
relationship between the boost::function and whatever it's wrapping, since
you need to explicitly mention the arguments and return type.
-Dave
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk