Re: Template elegance?

2015-06-03 Thread David Monagle via Digitalmars-d-learn
Wow, thanks very much anonymous. I did try that as a solution but stupid me was using an enum rather than an alias for the "shortcut" functions. Been staring at the problem for so long that I couldn't see the problem right in front of me! Appreciate the help greatly. Code now looks elegant a

Template elegance?

2015-06-03 Thread David Monagle via Digitalmars-d-learn
Hi guys, I was hoping some of you more experience D guys could educate me on this one. Given the following code: /// // Template function bool shouldValue(alias operation, string description, E, V)(lazy E expression, V value, string name="Value", string file = __FILE__, typeof(__LINE_

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 this.

Re: vibe.d error

2015-01-27 Thread David Monagle via Digitalmars-d-learn
What version of dub are you using?

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)

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;