D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13770 - can't mix template class and normal class
Summary: can't mix template class and normal class
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 12:10 UTC by galaxylang
Modified: 2020-05-25 08:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description galaxylang 2014-11-24 12:10:34 UTC
struct Opt
{
   Opt!T opCall(T)(T v)
   {
     .....
   }

}
struct Opt(T)
{
}


Error: class m.Opt conflicts with class m.Opt(T)
Comment 1 yebblies 2014-12-31 06:11:31 UTC
Why shouldn't it conflict?
Comment 2 basile-z 2020-05-25 08:15:05 UTC
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) }