Return values from auto function

Ferhat Kurtulmuş aferust at gmail.com
Fri Nov 6 20:05:36 UTC 2020


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


More information about the Digitalmars-d-learn mailing list