Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-08 08:20:57


On Tuesday 08 May 2001 12:08 am, you wrote:
> ----- Original Message -----
> From: "Douglas Gregor" <gregod_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Monday, May 07, 2001 5:30 PM
> Subject: Re: [boost] about function.hpp
>
> > > There is the possibility of making all 'boost::function's that contain
> > > functors compare as unequal. There may also be the possibility of an
> > > alternate 'boost::function' constructor which enables 'operator ==' for
> > > functors (and requires that functors provide 'operator ==').
> >
> > Yes, or even an external trait class that states whether or not a
> > function object is equality comparable. This would shift the burden to
> > those using operator== to specify that they indeed are using it. Still,
> > even this is unfortunate: if the user forgets to specialize the trait
> > class, the
>
> function
>
> > objects will (silently!) fail to ever be compared.
>
> On second thought, throwing an exception (or asserting 'false') would be
> preferable to simply comparing functors as unequal by default.

I agree. I believe they will be separate concepts (see the message I just
previously posted) so that we can keep any possibility problems with the
existence of operator== as compile-time errors instead of pushing them off to
run-time.

        Doug


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