What does C++ do better than D? - StackOverflow.com

Timon Gehr timon.gehr at gmx.ch
Mon Aug 1 16:16:54 PDT 2011


On 1/08/11 7:29 PM, Kagamin wrote:
> Walter Bright Wrote:
>
>> Now on reddit!
>>
>> http://www.reddit.com/r/programming/comments/j48tf/how_is_c_better_than_d/
>
> C++ has a better thought out type system.
> Nice joke.
> http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html
>
> Please read my note at the end. I believe D (probably) has a better type
> system. It just wasn't very well though out.
>
> I believe many aspects of D's type system were added in without fully
> exploring the ramifications they had on other parts of the language.
> There are at least two pieces of evidence which support my belief:
>
> 1. The fact that you can't copy const struct objects containing
> reference types.

You can copy them, but not to mutable. In exchange, you get transitive const.

>
> 2. The fact that the root object still isn't const correct.
>

I think it could be. It would just force everyone implementing opEquals to be
const correct too. Or is there any other fundamental issue?

>
> C++ has some questionable choices for its type system, but it generally
> doesn't prevent you from getting work done.

I have not yet been affected by any of your two issues. Do you have example use
cases where they prevent you from getting work done?

-Timon


More information about the Digitalmars-d mailing list