Bug 5525 – Eponymous templates should allow for overloaded eponymous members
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-02-04T14:22:00Z
Last change time
2012-03-08T22:54:57Z
Keywords
pull
Assigned to
nobody
Creator
simen.kjaras
Comments
Comment #0 by simen.kjaras — 2011-02-04T14:22:21Z
Given:
template foo( T ) {
T foo( T t ) {
return t;
}
T foo( T t, T u ) {
return t + u;
}
}
This should not cause problems. Basically, if a template contains an eponymous overload set, the overload set should be considered its only member.
Comment #1 by andrej.mitrovich — 2012-01-20T17:39:26Z
I think a recent fix enables templates with multiple members to still be used as eponymous templates, but I don't recall the Issue number..
Comment #2 by k.hara.pg — 2012-02-22T04:28:11Z
In dmd2.058, eponymous template hides internal names (fixing bug 4675).
But eponymous overload set isn't still allowed.
Workaround:
template foo( T ) {
T foox( T t ) {
return t;
}
T foox( T t, T u ) {
return t + u;
}
alias foox foo; // bundle overloads as eponymous member.
}