Library Typedefs are fundamentally broken
eles via Digitalmars-d
digitalmars-d at puremagic.com
Mon Sep 22 09:34:54 PDT 2014
On Monday, 22 September 2014 at 16:21:43 UTC, Wyatt wrote:
> On Saturday, 20 September 2014 at 04:52:58 UTC, Andrei
> Alexandrescu wrote:
>>
>> alias A = Typedef!float;
>> alias B = Typedef!float;
>>
>> By basic language rules, A and B are identical. Making them
>> magically distinct would be surprising...
>>
> Hold up. See, "Making them magically distinct would be
> surprising" is really the sticking point for me because in my
> experience it rings false.
>
> When I reach for a typedef, I expect these things to NOT be
> identical. More to the point, I'm explicitly stating: "This
> thing is not like any other thing." That's the fundamental
> reason any sort of typedef exists in my world.
IIRC, in the beginning, typedef was (assumed to be) just that.
The problem was that the conversion rules lacked and, finally,
nobody wrote them. Typedef itself became deprecated and merely a
synonim for "alias".
Too bad, since the "strong typedef" was one of the things that
dragged me into D from the C world...
More information about the Digitalmars-d
mailing list