Return values from auto function

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Sat Nov 7 01:40:04 UTC 2020


On Friday, 6 November 2020 at 20:05:36 UTC, Ferhat Kurtulmuş 
wrote:
> On Friday, 6 November 2020 at 10:51:20 UTC, Andrey Zherikov 
> wrote:
>> I have auto function 'f' that might return either an error 
>> (with some text) or a result (with some value). The problem is 
>> that the type of the error is not the same as the type of 
>> result so compilation fails.
>>
>> [...]
>
> Sounds like Andrei's "Expected". Here is an implementation for 
> d. https://github.com/tchaloupka/expected

Hmmm, I wonder how that is different from the idea of 'option'


More information about the Digitalmars-d-learn mailing list