In C ++, C-style casting is defined (§5.4) in terms of C ++ style. Thus, for each cast you can make a C-style, there is a corresponding C ++ - style (almost).
“Almost” is that a C-style cast ignores the accessibility of the base class. That is, the C ++ equivalent is not applicable for the following actions:
struct foo {}; struct bar : private foo {}; bar b; foo* f = (foo*)&b;
So no, it’s not strictly speaking to completely discard the C-style. But the number of areas in which there are not enough (in combination) C ++ styles is not enough.
The above "language answer". What you experience has nothing to do with C-style castes and C ++ castes, but just a compiler implementation. Warnings are absolutely implementation specific and have nothing to do with C ++.
So do not make mistakes when using your data in this particular compiler in this particular situation in order to conclude about C ++ in general.
GManNickG
source share