Re: Can't compile the code

2013-04-28 Thread Maxim Fomin
On Sunday, 28 April 2013 at 18:40:20 UTC, bearophile wrote: Ali Çehreli: The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; OK. But is it syntactically allowed in D to omit the variable name when there is a default argument? I have never seen

Re: Can't compile the code

2013-04-28 Thread bearophile
Ali Çehreli: The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; OK. But is it syntactically allowed in D to omit the variable name when there is a default argument? I have never seen it before... Bye, bearophile

Re: Can't compile the code

2013-04-28 Thread Ali Çehreli
On 04/28/2013 09:14 AM, bearophile wrote: Temtaime: auto f = (bool = false) {}; I don't understand this syntax. Bye, bearophile The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; Ali

Re: Can't compile the code

2013-04-28 Thread bearophile
Temtaime: auto f = (bool = false) {}; I don't understand this syntax. Bye, bearophile

Re: Can't compile the code

2013-04-28 Thread Ali Çehreli
On 04/28/2013 01:53 AM, Temtaime wrote: int main() { auto f = (bool = false) {}; f(); return 0; } I can't compile this code on DMD32 D Compiler v2.062 On windows. It says to me: Error: expected 1 function arguments, not 0 On linux it seems to work(http://ideone.com/

Can't compile the code

2013-04-28 Thread Temtaime
int main() { auto f = (bool = false) {}; f(); return 0; } I can't compile this code on DMD32 D Compiler v2.062 On windows. It says to me: Error: expected 1 function arguments, not 0 On linux it seems to work(http://ideone.com/fsKYWR).