Thread overview |
---|
October 30, 2008 Re: How does D improve design practices over C++? | ||||
---|---|---|---|---|
| ||||
Walter Bright Wrote: > Janderson wrote: > > - More restrictive casting what's this? From my point of view C++ has more restrictive casting. > - Warnings on implicit casts that lose bits O_O |
October 31, 2008 Re: How does D improve design practices over C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ore-sama | ore-sama wrote: > Walter Bright Wrote: > >> Janderson wrote: >>> - More restrictive casting > what's this? From my point of view C++ has more restrictive casting. We'll C++ allows C casts for instance. Also C++ you can static cast something that should be dynamic. Also in D you can't easily cast an array to a pointer (although you can go array.ptr). There are fewer implicit casts allowed (particularly for unsigned/signed). See: http://www.digitalmars.com/d/2.0/type.html I think there are a couple of others but I can't remember them at the moment. > >> - Warnings on implicit casts that lose bits > O_O |
October 31, 2008 Re: How does D improve design practices over C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Janderson | Janderson Wrote:
> I think there are a couple of others but I can't remember them at the moment.
I can remind: reinterpret_cast is explicit, type casts preserve constness, unsuccessful downcast to reference throws.
|
Copyright © 1999-2021 by the D Language Foundation