Virtual functions and inheritance

2015-01-26 Thread David Monagle via Digitalmars-d-learn
Hi guys, I'm a former C++ developer and really enjoying working with D now. I have a question that I hope some of you may be able to answer. class Parent { @property string typeName() { return typeof(this).stringof; } } class Child : Parent { } void main() { auto p = new Parent;

Re: Virtual functions and inheritance

2015-01-26 Thread David Monagle via Digitalmars-d-learn
I can certainly work with that. Thank you very much! (and for pointing out my typo in the example)

Re: class is forward referenced when looking for 'v'

2015-01-29 Thread David Monagle via Digitalmars-d-learn
It's a bit hard to know where to start here. It's not obvious from your code what you are trying to achieve. In essence, you do have a circular reference as Base has functions that use a types A and B which are derived from the Base. I don't see how the complier could be asked to resolve