Unable to instantiate template with same name as function

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 3 12:13:49 PST 2016


On 03.03.2016 07:12, Shriramana Sharma wrote:
> string ta(string s) { return s ~ "1"; }
> template ta(string s) { enum ta = ta(s); }

In `ta(s)` here, `ta` is the enum itself again. It's similar to `int x = 
x;`. Can't do that, of course.

Add a leading dot to refer to the module level `ta` symbols instead: 
`enum ta = .ta(s);`.


More information about the Digitalmars-d-learn mailing list