Bug 13770 – can't mix template class and normal class
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-24T12:10:34Z
Last change time
2020-05-25T08:15:05Z
Assigned to
No Owner
Creator
galaxylang
Comments
Comment #0 by galaxylang — 2014-11-24T12:10:34Z
struct Opt
{
Opt!T opCall(T)(T v)
{
.....
}
}
struct Opt(T)
{
}
Error: class m.Opt conflicts with class m.Opt(T)
Comment #1 by yebblies — 2014-12-31T06:11:31Z
Why shouldn't it conflict?
Comment #2 by b2.temp — 2020-05-25T08:15:05Z
templates can only have overloads that are also templates. Also the pattern that was tried here (so IFTI i believe) is usually more done using
opt(T)(T t) { return Opt!T(t) }