On Mon, 28 Jun 2010 16:01:46 +0200, BCS wrote:
Hello Rory,
On Sun, 27 Jun 2010 17:17:25 +0200, Philippe Sigaud
wrote:
void main()
{
auto fun(string s) { return s;} // this does not compile
}
Hope this isn't a stupid question, but how would you access this
function
if it did work?
Would i
On Mon, 28 Jun 2010 16:07:43 +0200, Philippe Sigaud wrote:On Mon, Jun 28, 2010 at 15:40, Rory McGuire wrote:
void main()
{
auto fun(string s) { return s;} // this does not compile
}
Hope this isn't a stupid question, but how would you access this function if it di
Hello Rory,
On Sun, 27 Jun 2010 17:17:25 +0200, Philippe Sigaud
wrote:
void main()
{
auto fun(string s) { return s;} // this does not compile
}
Hope this isn't a stupid question, but how would you access this
function
if it did work?
Would it be fun("asdf")?
Is this just shorthand for:
auto
On Sun, 27 Jun 2010 17:17:25 +0200, Philippe Sigaud
wrote:
Is it defined somewhere that auto functions are not authorized inside
main?
void main()
{
auto fun(string s) { return s;} // this does not compile
}
error:
main.d|6|found 's' when expecting ')'|
main.d|6|semicolon expected, n
Philippe Sigaud:
> I couldn't find a bugzilla entry for this and I cannot believe no one ever
> tried to put an auto fun inside main!
Maybe auto funcs are seen as instantiated templates, and templates can't be
defined inside functions. Anyway, I think you can file this as enhancement
request.
B