how come is this legal? 'void fun(int){ }' ?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 13 22:39:59 PDT 2015


On Sun, 14 Jun 2015 05:11:17 +0000, Maxim Fomin wrote:

> On Sunday, 14 June 2015 at 01:20:39 UTC, Timothee Cour wrote:
>> I understand this is legal for declaration wo definition (void
>> fun(int);)
>> but why allow this:
>> void test(int){} ?
> 
> Actually it is void test(int _param_0) { }
> You can test by compiling void test(int) { _param_0 = 0; }
> 
> Nameless parameters are simulated by providing internal symbol as above.

yet one shouldn't rely on generated names, they are undocumented on 
purpose, and can change without a notice and deprecation cycle.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150614/39fc18da/attachment.sig>


More information about the Digitalmars-d-learn mailing list