Boost logo

Boost :

From: scleary_at_[hidden]
Date: 2002-09-23 07:45:23


> From: Peter Dimov [mailto:pdimov_at_[hidden]]
> > From: "David Abrahams" <dave_at_[hidden]>
> > BTW, implementation notions:
> >
> > 1. Should we think about optimizing away storage for the deleter when
it's
> > known to be stateless?
>
> We might, although I'm not convinced that it's worth it.

I've been playing a bit with the unary_traits and binary_traits in
Boost.Functional, and one thing I've found useful is to add an
"object_type", so that:
  unary_traits<FObj>::object_type == FObj
  unary_traits<FPtr>::object_type == pointer_to_unary_function<FPtr>
and similar for member pointers and binary_traits.

This makes it easy to save space for objects that need to contain a function
object/pointer, by just deriving from
[unary|binary]_traits<FObjOrPtr>::object_type. This approach can also be
applied to all the adaptors/binders in Boost.Functional (e.g.,
unary_negate).

        -Steve


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