Library Typedefs are fundamentally broken
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 20 08:26:37 PDT 2014
On 9/19/14, 11:50 PM, Dicebot wrote:
> On Saturday, 20 September 2014 at 04:52:58 UTC, Andrei Alexandrescu wrote:
>> This is wrong but probably not worth fighting. Consider:
>>
>> alias A = Typedef!float;
>> alias B = Typedef!float;
>>
>> By basic language rules, A and B are identical. Making them magically
>> distinct would be surprising and would require explanation. It's as if
>> someone writes:
>>
>> struct Point { int x, y; }
>> alias A = Point;
>>
>> and then later in the same module
>>
>> alias B = Point;
>
> But Typedef is not some generic symbol. It is library type specifically
> introduced as `typedef` keyword replacement and advertised as such. I
> expect it to work as close to `typedef` as possible being the most
> priority. Otherwise it is simply useless.
No. -- Andrei
More information about the Digitalmars-d
mailing list