Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-10-15 08:17:52


On Wednesday 15 October 2003 09:09 am, Thorsten Ottosen wrote:
> I havn't thought this through, but just wanted to ask about it
>
> > Comparison between boost::function objects cannot be implemented "well",
>
> and
>
> > therefore will not be implemented. The typical semantics requested for f
>
> == g
>
> > given boost::function objects f and g are:
> >
> > * If f and g store function objects of the same type, use that type's
> > operator== to compare them.
> > * If f and g store function objects of different types, return false.
> >
> > The problem occurs when the type of the function objects stored by both f
>
> and
>
> > g doesn't have an operator==:.
>
> It seems to me that the problem only amounts to typeid( f1 ) == typeid( f2

Won't help. The problem with this feature is that it looks like there is a
very obvious implementation, because it's easy to do something similar when
you have all the (static) type information you need. In function, you only
have the dynamic type information and you can never go back.

        Doug


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