|
-
February 11th, 2004, 09:44 AM
#1
Operator (cast) override vs. static_cast et al.
Ok, so I have a class that overrides the (const char *) operator. This override returns a C string that is not the same as the pointer to the class.
Which, if any, of these calls will invoke the overridden operator, and which will merely reinterpret the class' pointer?
reinterpret_cast<const char *>
static_cast<const char *>
dynamic_cast<const char *>
This is a serious issue because people are starting to blindly clean up Lint problems, one of which is whining about using old style C casts. For now we are avoiding correcting that warning.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|