enum return type

Adam D. Ruppe destructionator at gmail.com
Wed Mar 5 15:36:33 PST 2014


On Wednesday, 5 March 2014 at 23:17:45 UTC, Frustrated wrote:
> is it a purely compile time construct?

I think it is the same as auto return functions. Both auto and 
enum in this context are storage classes. In the compiler, it 
looks like enum in this context forwards to parse declaration, 
just like keywords such as pure, which can then find it is a 
function. If I'm reading this correctly, it does set the manifest 
constant flag, but otherwise just ignores it and indeed treats it 
the same as an auto return value.

So nothing special, arguably just the parser not throwing an 
error when it perhaps could.


More information about the Digitalmars-d-learn mailing list