Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-10-15 09:30:44


From: "Douglas Gregor" <gregod_at_[hidden]>

> > 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.

but don't you have the static type information when one makes an assignment
like

boost::function<float (int x, int y)> f;struct int_div {
  float operator()(int x, int y) const { return ((float)x)/y; };
};f = int_div;

?

And couldn't that be saved for later eg. by type_info references ?

Thorsten


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