Jan 18, 2012

[C++] dynamic_cast with reference

When using dynamic_cast on reference, unlike pointer,

if it can not downcast, with pointer, it will return 0;

as for reference, it will throw bad_cast exception

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.