|
-
July 29th, 2005, 05:37 AM
#8
Re: How do you call "func()" vs "func() const"?
 Originally Posted by freddyflintstone
const_cast works as well of course but the"style" guideline of most (authors) is to use static_cast to add const-ness.
Of course, it is better to use static_cast, because static_cast can only add const specifiers. It is not dangerous.
const_cast can remove const specifier, and should be avoided if possible (but it cannot be always avoided, for example when linking with libraries which don't use const specifiers).
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
|