'Auto can only be used for template function arguments' what?

Mehrdad wfunction at hotmail.com
Tue Jun 26 17:54:49 PDT 2012


On Tuesday, 26 June 2012 at 16:37:30 UTC, Timon Gehr wrote:
> On 06/26/2012 06:17 PM, Mehrdad wrote:
>> void test1(T)(auto ref T) { }
>> void test2() { int a = 5; test1!(int)(a); }
>>
>> Is there any reason this should fail?
>
> There is not. I suppose the compiler completes instantiation 
> without
> looking at the function parameter.

Well the problem manifests itself in different ways, but would it 
be safe to say that

	void foo(auto ref int) { }

should not cause problems either?


More information about the Digitalmars-d mailing list