casting & templates
Robert M. Münch via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jan 31 10:59:01 PST 2016
I have:
class OperatorV(T) : Value {
T impl;
this(T impl) {
this.impl = impl;
}
...
and use it like this: makeOperator((IntV a, IntV b) => new IntV(a.num +
b.num));
Now I want to do: opWord.get() returns a Value
OperatorV *op = cast(OperatorV*)(opWord.get());
and get: Error: class app.OperatorV(T) is used as a type
Hmm... any idea? Don't know how to carry the template stuff around.
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
More information about the Digitalmars-d-learn
mailing list