Boost logo

Boost Users :

From: Jaakko Järvi (jarvi_at_[hidden])
Date: 2006-02-17 09:41:31


On Feb 17, 2006, at 8:09 AM, Roman Krylov wrote:

> Hi all.
> I want to make function comparing two typeid's 'const T&'s , but in
> context I have only two T* pointers.
> T is abstract class having pure virtual functions.
> typeid operator takes reference, not pointer.
> If I use * operator on placeholder (ll_typeid(*_1)==ll_typeid(*_2)) -
> compiler complains that it could not instantiate T somewhere in some
> complex template.

This is a known nasty bug in lambda, that arises with abstract base
classes, and
I haven't fixed it. It is fixable but not quickly.

   Best, Jaakko

> I also tried to use ll_static_cast in expression, but it didn't help.
> I don't attach those error messages, but anyway why should T be
> instantiated to construct L-expression with *(T*)?
> By the way I made simple functor and it works the way I want, but
> it's 6
> lines long instead of one in_place expr. :
>> template<typename T>
>> struct compareRefsByTypeID
>> {
>> bool operator()(const T* t1, const T* t2)
>> { return typeid((const T&)(*t1))==typeid((const T&)(*t2)); }
>> };
> regards,
> Roman.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net