Showing TypeFunction style

Stefan Koch uplink.coder at googlemail.com
Sun Oct 4 08:07:40 UTC 2020


On Sunday, 4 October 2020 at 05:14:02 UTC, Timon Gehr wrote:
> On 04.10.20 07:04, Basile B. wrote:
>> On Saturday, 3 October 2020 at 21:36:20 UTC, Stefan Koch wrote:
>>> On Saturday, 3 October 2020 at 14:16:09 UTC, Basile B. wrote:
>>>> [...]
>>>
>>> type functions are supposed to support UFCS.
>>> How would I do that with the calling syntax you propose?
>> 
>> UFCS style still works:
>> 
>>    size_t SizeOf(alias T){ return T.sizeof; }
>> 
>>    static assert (SizeOf!!(ubyte) == 1);
>>    static assert (ubyte!!SizeOf() == 1);
>>    static assert (ubyte!!SizeOf == 1);
>> 
>> although you clearly loose the feel that it's like a builtin 
>> property.
>
> IMO this is ugly and unnecessary. The distinction between types 
> and expressions in the parser is pointless anyway.

Yes that's what I meant to say.


More information about the Digitalmars-d mailing list