August 30, 2004 What is the official view on the use of cast() ? | ||||
---|---|---|---|---|
| ||||
Is cast() considered something to be used as sparingly as possible? For instance, is it there to get you out of a jamb? Or, is cast() expected to be used regularly, and as a matter of course? |
August 30, 2004 Re: What is the official view on the use of cast() ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to antiAlias | "antiAlias" <fu@bar.com> wrote in message news:cgvqdh$2ove$1@digitaldaemon.com... > Is cast() considered something to be used as sparingly as possible? For > instance, is it there to get you out of a jamb? Or, is cast() expected to be > used regularly, and as a matter of course? > I'd say it depends. It's ok when working with void* or void[], when casting object types and checking for null, and when casting different number types (int, float, long; etc). Other than that, it should be avoided for safety. |
Copyright © 1999-2021 by the D Language Foundation