If you could make any changes to D, what would they look like?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Oct 20 18:02:13 UTC 2021


On Wednesday, 20 October 2021 at 17:28:30 UTC, Guillaume Piolat 
wrote:
> On Wednesday, 20 October 2021 at 11:41:32 UTC, Adam D Ruppe 
> wrote:
>>
>> I don't really think it is worth the hassle but it is 
>> interesting in that it solves some old syntax worries.
>
> One of the problem C++ has with 
> objects-with-inheritance-as-value-type is "object slicing".
>
> It is ugly in theory: https://stackoverflow.com/a/14461532

Never had any issues with this in real life, this is one of many 
things you should think about when modelling.

The real "problem" with C++ is that it both provides a lot of 
flexibility-for-responsible-designers, but also provides 
defaults. Since people don't write the default it is easier to 
forget to adjust the semantics of all member functions to the 
model.




More information about the Digitalmars-d mailing list