auto return for some recursive functions in C++11

via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 15 11:46:51 PST 2015


On Thursday, 15 January 2015 at 00:05:32 UTC, Xinok wrote:
> I played with it a bit and it seems to deduce a common type 
> from all the return statements, which would be more in the 
> style of D anyways (take type deduction for arrays).

Yes, this has changed some time ago, the specs are already 
updated:
http://dlang.org/function.html#auto-functions

Given that the compiler already uses the common type, maybe it 
should just disregard recursive uses during inference if there is 
more than one return.


More information about the Digitalmars-d mailing list