Boost logo

Boost Users :

From: Roman Krylov (Roman.Krylov_at_[hidden])
Date: 2006-02-17 09:09:42


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