[Issue 8204] Can't instantiate auto ref template explicitly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 4 10:06:12 UTC 2020


Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
           Keywords|                            |diagnostic
                 CC|                            |b2.temp at gmx.com

--- Comment #7 from Basile-z <b2.temp at gmx.com> ---
There are tricks to generate the ref version or not:

void foo(T)(ref auto T v)

alias intByVal = typeof(foo(0));
alias intByRef = typeof(foo(*new int));

struct S{}

alias sByVal = typeof(foo(S()));
alias sByRef = typeof(foo(*new S()));  

> void runnable.foo!int.foo(int v)
> void runnable.foo!int.foo(ref int v)
> void runnable.foo!(S).foo(S v)
> void runnable.foo!(S).foo(ref S v)

But the error message is not encouraging.


More information about the Digitalmars-d-bugs mailing list