You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/11/02 05:20:02 UTC

DO NOT REPLY [Bug 4581] - erroneous static cast in programming examples

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4581>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4581

erroneous static cast in programming examples

jason@openinformatics.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



------- Additional Comments From jason@openinformatics.com  2001-11-01 20:20 -------
Why is this incorrect?

DefaultHandler "is a" ErrorHandler and 
DefaultHandler "is a" ContentHandler.

So I can cast the DefaultHandler to any one of it's subclasses without trouble. 

The code could be written as:

DefaultHandler* dh = new DefaultHandler();
ContentHandler* ch = (ContentHandler*) dh
ErrorHandler*   eh = (ErrorHandler*) dh;

but it's all the same code.

Or am I missing something?

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org