Attribute inference for auto functions?
Walter Bright
newshound2 at digitalmars.com
Wed Apr 17 18:52:04 PDT 2013
On 4/17/2013 6:28 PM, deadalnix wrote:
> Points raised in the thread show that people need in general to be able to
> annotate specifically the return type or whatever, and this is rather difficult
> with the current state of thing (and also it seems quite hard to fix).
To annotate the return type specifically with, say, const:
const(T) foo();
And in fact const with parens works as a general type constructor:
const(T)* foo(); // return mutable pointer to const T
const without parens applies to the declaration.
More information about the Digitalmars-d
mailing list