Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-06-07 19:42:34


>>
> --------
>
> The library defines a class nil_t and an object nil. While it's nice to
> have these around, they are not mentioned in the documentation, and I'm
> not sure they belong in the function library. And I think the library's
> design works fine without these -- it seems more a matter of personal
> taste that they are included.

They exist because we can't easily have:
boost::function<> f;
f = 0;

This requires a "const int" overload of operator=, which allows the
nonsensical:
f = 7;

Even worse, we can't detect this abuse at compile-time, so it becomes a
runtime issue.

nil/nil_t is meant to be freestanding and has almost nothing to do with
boost::function. It is included as part of function because it is used
there,
but I think should be its own "library" (insofar as 6 lines constitutes a
library...).

<<

a nil and a const_nil are used by the tuples library (coming up for review
June 17th!) and so boost would benefit if this was indeed a stand-alone
include. The tuple versions are in their own namespace, so no conflicts
unless you totally open up the namespaces with a couple of "using"
statements.

  Yours,
 -gary-

gary.powell_at_[hidden]


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