<div class="gmail_quote">2011/11/17 Sergey Radionov <span dir="ltr"><<a href="mailto:rsatom@gmail.com">rsatom@gmail.com</a>></span><br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
But not, it has one more:<br>"C cast" is closer to C++ dynamic_cast<>, then to static_cast<>. So it allow catch problems when static_cast's argument type changed to inconsistent with <destination type> (it will be compilation error), but "C cast" will not show even warning...<br>
</blockquote><div> </div><div>Hi,</div><div> </div><div>Maybe this should rather go on a C++ newsgroup/forum but I think a slight correction is needed.</div><div> </div><div>While it's true that static_cast<> is stricter than a c-style cast, and therefore will produce more warnings/errors (one could say it is safer, although one still has to know what they're doing), saying a c-style cast is closer to a dynamic_cast<> than a static_cast<> is wrong.</div>
<div> </div><div>A c-style cast has nothing dynamic in it, the cast happens at compile time. There is no runtime check at all with c-style casts.</div><div> </div><div>-- <br>Tristan LANFREY<br>
</div></div>