Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-06-11 20:33:16


On Monday 11 June 2001 18:15, you wrote:
> [Jens Maurer wrote]
>
> > The function library currently under review contains a type
>
> 'nil_t' with an
>
> > instance 'nil'. It is a replacement for "0" or "NULL" in any code. The
> > implementation is trivial, but it should probably be placed in its own
>
> header
>
> > because it's usefulness extends beyond 'function'. The code is just:
>
> If we decide to have some kind of null pointer with a separate
> type, it should be in a separate header file (or possibly in utility.hpp
> if simple enough). It appears to have uses in template metaprogramming
> as well (end-of-tuple) (Gary).
> On the other hand, the template metaprogramming usage seems to
> be sufficiently different from the value-based view we have in
> boost.function that these may well be two different types.
>
> > namespace boost {
> > struct nil_t
>
> I'd like to see more experience with the need to zero boost.function
> objects where func.clear() is not possible. Otherwise, I'd like
> to avoid the nil issue in the first round.
> <<
> Now having seen the problem I'd like to have a acceptance of function with
> a "pending/nil.hpp" implementation of nil, that both function, Spirit, and
> Tuples could use. Tuples just needs a unique type. I think Spirit does too.
> So the value conversion stuff is all for function and whatever else needs
> it. And whatever changes are made, Spirit and Tuple libraries should be
> just fine.
>
> Then schedule a review of nil.hpp soon.
>
> Yours,
> -gary-
>
>
> gary.powell_at_[hidden]

Function doesn't require the value conversion portion of nil, it just needs
the unique type. The value conversion portion exists because of consistency
(new code _could_ use nil everywhere instead of 0, but 0 can't be used
everywhere nil can).

        Doug


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