Return values from auto function

Andrey Zherikov andrey.zherikov at gmail.com
Fri Nov 6 14:19:11 UTC 2020


On Friday, 6 November 2020 at 13:59:58 UTC, gbram wrote:
> On Friday, 6 November 2020 at 12:03:01 UTC, Paul Backus wrote:
>> On Friday, 6 November 2020 at 10:51:20 UTC, Andrey Zherikov 
>> wrote:
>>>
>>> How can I make the original code compilable without 
>>> templatizing `failure` function?
>>
>> You can't. Both return values have to have the same type, 
>> which means the failure function has to be able to return more 
>> than one type, which means it has to be a template.
>
> Being pedantic, he can, by templatising 'f' instead.

Could you share how?


More information about the Digitalmars-d-learn mailing list