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

  • casting & templates Robert M. Münch via Digitalmars-d-learn

Reply via email to