If you could make any changes to D, what would they look like?
Ali Çehreli
acehreli at yahoo.com
Wed Oct 20 21:05:44 UTC 2021
On 10/20/21 11:02 AM, Ola Fosheim Grøstad wrote:
> On Wednesday, 20 October 2021 at 17:28:30 UTC, Guillaume Piolat wrote:
>> 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,
Me neither because I was following convention in C++: "Pass inherited
types by reference because there is slicing." That rule renders C++
classes (and structs) of inheritance hierarchies "reference types". I
like D's (and Java's and C#'s) approach here.
Ali
More information about the Digitalmars-d
mailing list