Re: Fighting compiler - experienced programmer but D novice

2014-06-03 Thread Jacob Carlborg via Digitalmars-d-learn
On 03/06/14 05:57, Charles Parker wrote: Chris, that was it I needed to do both things. It then complained about trying to allocate the in_edges and out_edges arrays in the constructor which is how I thought dynamic arrays are allocated on the heap. I removed the 2 new statements, and both

Fighting compiler - experienced programmer but D novice

2014-06-02 Thread Charles Parker via Digitalmars-d-learn
./graph_structures.d(124): Error: class graph_structures.node(D, E) is used as a type I have no idea what this means:( Once we create a class, the textbook examples show its use as a type which I believe is what C++ Java allow. Here's some code: class node(D, E) { int nid; D data;

Re: Fighting compiler - experienced programmer but D novice

2014-06-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jun 03, 2014 at 03:17:09AM +, Charles Parker via Digitalmars-d-learn wrote: ./graph_structures.d(124): Error: class graph_structures.node(D, E) is used as a type I have no idea what this means:( It usually means you tried to use an uninstantiated template as a type. [...]

Re: Fighting compiler - experienced programmer but D novice

2014-06-02 Thread Chris Cain via Digitalmars-d-learn
On Tuesday, 3 June 2014 at 03:17:10 UTC, Charles Parker wrote: ... Thanx for any help - Charlie Well one thing is that you don't need the type parameters on the this function. You're basically creating a templated this inside the templated class which is not what you want. try this:

Re: Fighting compiler - experienced programmer but D novice

2014-06-02 Thread Charles Parker via Digitalmars-d-learn
On Tuesday, 3 June 2014 at 03:35:46 UTC, Chris Cain wrote: On Tuesday, 3 June 2014 at 03:17:10 UTC, Charles Parker wrote: ... Thanx for any help - Charlie Well one thing is that you don't need the type parameters on the this function. You're basically creating a templated this inside the