auto limitation?

Simen Kjaeraas simen.kjaras at gmail.com
Tue Sep 11 12:07:37 PDT 2012


On Tue, 11 Sep 2012 20:57:07 +0200, Maxim Fomin <maxim at maxim-fomin.ru>  
wrote:

> I think it is UB rather than a bug. The spec says that return types must  
> match exactly. AFAIK auto is a feature to infer return type, not to  
> magically adjust to multiple incompatible types.

I'd be surprised if this were not a bug. My expectation would be that the
types be combined as with the ?: operator, just like std.traits.CommonType.

If this is not a bug, it's certainly worth filing as an enhancement  
request.

-- 
Simen


More information about the Digitalmars-d-learn mailing list