Bug or "hidden" feature?

Timon Gehr timon.gehr at gmx.ch
Mon Nov 6 18:02:26 UTC 2017


On 06.11.2017 10:50, bauss wrote:
>>>
>>
>> Feature as return type is not necessary and considered auto when some 
>> qualifiers are added
>>
>> const foo() {}
>>
>> @property foo() {}
>>
>> etc
> 
> Yeah I was aware of it for build-in attributes, but didn't know it 
> applied to user-defined attributes. 
This is a common misconception. Auto means 'automatic storage' (a C 
leftover), not 'automatic type deduction'. 'auto' (or some other storage 
class/attribute) is only required to make it clear that what follows is 
a declaration. To enable type deduction, just don't specify the type.


More information about the Digitalmars-d mailing list