
21 Aug
2010
21 Aug
'10
10:55 a.m.
Sent from my iPhone On Aug 20, 2010, at 9:09 PM, Emil Dotchevski <emil@revergestudios.com> wrote:
One option is to "fix" them anyway. Unfortunately, a lot of times this involves casting, and in general I find it ill-advised to use a cast to suppress a warning. Think about it: casts are used to tell the compiler to do something it wouldn't normally do because it is dangerous. This is true for all casts, including the ones people sprinkle around to "fix" warnings.
True, but you can often avoid those casts by allowing (presumably safer) implicit conversions to do the same work,e.g. instead of static_cast<Base&>(derived), declare and initialize a named Base&.