
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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users