Re: UFCS in template function

2013-08-29 Thread Jacob Carlborg
On 2013-08-29 22:02, Andrej Mitrovic wrote: However it does work for local imports (I think this was new in 2.063): void main() { import std.range; assert([].empty); // ok } "empty" is declared at module scope. -- /Jacob Carlborg

Re: UFCS in template function

2013-08-29 Thread Andrej Mitrovic
On 8/29/13, Jacob Carlborg wrote: > UFCS only works for module level functions. However it does work for local imports (I think this was new in 2.063): void main() { import std.range; assert([].empty); // ok }

Re: UFCS in template function

2013-08-29 Thread ixid
On Thursday, 29 August 2013 at 06:23:32 UTC, Jacob Carlborg wrote: UFCS only works for module level functions. What is the reason for this limitation?

Re: UFCS in template function

2013-08-28 Thread Jacob Carlborg
On 2013-08-28 23:28, ixid wrote: UFCS does not work in this template where the normal function call syntax will work: template test(alias fun) { auto test(T)(T n) { return n.fun; } } Is this the same as the inability to use UFCS with functions declared in the same scope as th

UFCS in template function

2013-08-28 Thread ixid
UFCS does not work in this template where the normal function call syntax will work: template test(alias fun) { auto test(T)(T n) { return n.fun; } } Is this the same as the inability to use UFCS with functions declared in the same scope as the call? Is there no