No we should not support enum types derived from strings

deadalnix deadalnix at gmail.com
Wed May 12 17:07:13 UTC 2021


On Wednesday, 12 May 2021 at 16:46:40 UTC, Ola Fosheim Grøstad 
wrote:
> On Wednesday, 12 May 2021 at 16:38:10 UTC, Ola Fosheim Grøstad 
> wrote:
>> typeid(a) is A*, because that is the type of the pointer. 
>> However, the relationship between B* and A* is polymorphic, 
>> because you can use B* in the context where you expect A*? 
>> E.g. you can call a function that expects paramater A* with a 
>> pointer B*. So that makes the relationship polymorphic?
>
>
> To be more precise. B* is a subtype of A* if you can use B* in 
> contexts where A* is expected, which is polymorphic in nature.
>

I would say it is a sybtype, yes, but polymorphism imply that 
there are several ways to see the same thing, which, as Andrei 
points out, imply that you go through a reference somewhere.



More information about the Digitalmars-d mailing list