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
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
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
Temtaime:
auto f = (bool = false) {};
I don't understand this syntax.
Bye,
bearophile
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/
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).