Bug 5067 – no way to re-parameter a template a class when in some special scope

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-10-16T22:36:00Z
Last change time
2010-11-04T22:27:32Z
Assigned to
nobody
Creator
galaxylang

Comments

Comment #0 by galaxylang — 2010-10-16T22:36:22Z
//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 by galaxylang — 2010-10-16T22:43:28Z
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)) { }