Unexpectedly nice case of auto return type

Basile B. b2.temp at gmx.com
Tue Dec 3 09:44:20 UTC 2019


On Tuesday, 3 December 2019 at 08:47:45 UTC, Andrea Fontana wrote:
> On Tuesday, 3 December 2019 at 07:24:31 UTC, Basile B. wrote:
>>
>>     A testA()
>>     {
>>         return alwaysReturnNull(); // Tnull can be implictly 
>> converted to A
>>     }
>>
>> still nice tho.
>
> Why not [1]?
>
> [1] typeof(null) alwaysReturnNull() { ... }
>
> Andrea

Yeah nice, that works instead of auto.

That reminds me of the discussion about TBottom.


More information about the Digitalmars-d-learn mailing list