On type functions

Timon Gehr timon.gehr at gmx.ch
Wed May 6 14:28:20 UTC 2020


On 04.05.20 19:09, Stefan Koch wrote:
> On Monday, 4 May 2020 at 15:55:44 UTC, Paul Backus wrote:
>> On Monday, 4 May 2020 at 15:42:01 UTC, Steven Schveighoffer wrote:
>>> On 5/3/20 5:22 PM, Stefan Koch wrote:
>>>> On Sunday, 3 May 2020 at 21:14:43 UTC, Max Samukha wrote:
>>>>> [...]
>>>>
>>>> Yes that's what it means!
>>>
>>> I had thought this might work, but I'm not sure.
>> [...]
>>> One other thing that is unclear is that map is supposed to take it's 
>>> list *first* for UFCS. This would have to be different, as variadics 
>>> typically come at the end of argument lists.
>>>
>>> -Steve
>>
>> If I understand the proposal correctly, it should be ok handle UFCS 
>> the same way std.algorithm.map does, by taking the function as a 
>> template argument:
>>
>> auto map(alias f)(alias[] a) {
>>     // etc
>> }
> 
> In my current draft type functions are not overload-able.
> And having UFCS work was never really something I thought about.
> I would like to work on a version which does not take UFCS just as a 
> first step.

That's a bit concerning. Why would overloading and UFCS require a 
separate implementation for type functions and functions that do not 
operate on types?


More information about the Digitalmars-d mailing list