D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5067 - no way to re-parameter a template a class when in some special scope
Summary: no way to re-parameter a template a class when in some special scope
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-16 22:36 UTC by galaxylang
Modified: 2010-11-04 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description galaxylang 2010-10-16 22:36:22 UTC
//no way to re-parameter a template a class when in some special scope 
class base(alias D)
{
  alias D!(int) special ;//error,D is not a template class
   //so function like this can't pass complie  
  auto change(T:long)()
  {
    return new special();//for example change devide!int to devide!long
  }
}

class devide(T:int):base!(devide)
//i think maybe because here: devide = devide!(T)
{
 
}
int main(char[][])
{
 return 0;
}
Comment 1 galaxylang 2010-10-16 22:43:28 UTC
there are some different?i am not sure 
class A(alias T)
{
}
and
class B(T)
{
}
//i think if there are different,can be solve the question i mentioned

class D(P):A!D   //base class is a type of A!(D),D is a symbol 
{
}
class D(P):B!D  //base class instance is a type of B!(D!(P)) 
{

}