> Hi Michael, Hi, Axel, > I use to take 'static_cast' in order to obtain a > DOMElement-pointer from a DOMNode-pointer. But usually I > check the type of the node actually to be > DOMNode::ELEMENT_NODE before performing the cast. I use reinterpret_cast in my code sometimes just because it is ugly enough to draw attention to itself. I almost always consider it as a matter to change either implementation or architecture.
> static_cast is a weaker concept than dynamic_cast, sure. > However, static_cast is a stronger concept than > reinterpret_cast, since the compiler can check if there is a > descent relationship between the types. You are right. It shall do the job provided there are no virtual bases and no pointers that point the other objects we believe. > BTW: do there exist any C++-compilers which do not understand > static_cast? I believe all modern (and not that modern) compilers understand xxx_cast expressions. But there likely to be some bugs in implementations (off the top of my head I can recall some known problems with exact type determination in exception specifications). So, for general purpose libraries like Xerces is it is considered to be OK not to rely upon the language (at least for C++) built-in dynamic types support. Thanks a lot for your help. -- Michael Kochetkov. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]