www.digitalmars.com         C & C++   DMDScript  

D - Odd template error - tree.zip

reply resistor mac.com writes:
OK, another template question.

I've attached the files illustrating the error.

I keep getting an error saying:
"template instance Tree!(int) Tree is not a template declaration"

That's it.  No file name.  No line numbers.  I've checked through all the
involved files for stupid mistakes, but I don't see any.

So what's it talking about?

Owen


begin 0644 tree.zip

M$?,[0%5X!`#H

MUO#JQFF
M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=FUZ60UM AE72C9'TK9=>:C%:)(
MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=18'1/&*,4&NE.+
M;UJL(=6\UX0ES/'2#ETW

M=L"5NM-&KG"XR'[`U%=D!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=I]\VVQ::_CF2ZI
M,[[6=%LB50\&NI$Q$63=EIM1?;\P7P[Q=-8WY&GXCS0[_7PHZ:;0 VWZ&[ZX


MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
M8/<%0AZ_\P6ME*D=X)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=*^38`6J"Q$6\$,,%,Y!'MRW]I6`
MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=K#CCY

MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

MQ443>)EY\[VIIC8H!'EN+)F=)*WC9:C%DG.\=60]2-4X!X>H%;6`!^>LL^11

M^N*R:3-200543N\\X;[D#V
MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
M+'/05#XZ
M````I($`````=&5S="YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
M964N9%54!0`#CR
M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

`
end
Feb 24 2004
parent reply resistor mac.com writes:
Just in case this attachment didn't work either, it's also at
http://fortytwo.athensacademy.net/tree.zip

In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says...
OK, another template question.

I've attached the files illustrating the error.

I keep getting an error saying:
"template instance Tree!(int) Tree is not a template declaration"

That's it.  No file name.  No line numbers.  I've checked through all the
involved files for stupid mistakes, but I don't see any.

So what's it talking about?

Owen


begin 0644 tree.zip

M$?,[0%5X!`#H

MUO#JQFF
M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=FUZ60UM AE72C9'TK9=>:C%:)(
MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=18'1/&*,4&NE.+
M;UJL(=6\UX0ES/'2#ETW

M=L"5NM-&KG"XR'[`U%=D!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=I]\VVQ::_CF2ZI
M,[[6=%LB50\&NI$Q$63=EIM1?;\P7P[Q=-8WY&GXCS0[_7PHZ:;0 VWZ&[ZX


MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
M8/<%0AZ_\P6ME*D=X)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=*^38`6J"Q$6\$,,%,Y!'MRW]I6`
MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=K#CCY

MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

MQ443>)EY\[VIIC8H!'EN+)F=)*WC9:C%DG.\=60]2-4X!X>H%;6`!^>LL^11

M^N*R:3-200543N\\X;[D#V
MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
M+'/05#XZ
M````I($`````=&5S="YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
M964N9%54!0`#CR
M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

`
end
Feb 24 2004
parent reply larry cowan <larry_member pathlink.com> writes:
It appears that your independent compiles do not actually force an instantiation
of any templates until your test.d does so, then in trying to instantiate a
BinaryTree there, the first one hit is Tree which is a class not a template.
(Since BinaryTree is also a class rather than a template, I don't know why it
didn't complain there first.  It must be trying to build from the ground up in
some sense.) To create an instance of a class object you use 'new', but for what
I think you're trying to do you should be defining templates rather than
classes.  Not a lot of change to your code actually.

Send me an email at larrycowan comcast.net and I'll reply with some sample code.

In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says...
Just in case this attachment didn't work either, it's also at
http://fortytwo.athensacademy.net/tree.zip

In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says...
OK, another template question.

I've attached the files illustrating the error.

I keep getting an error saying:
"template instance Tree!(int) Tree is not a template declaration"

That's it.  No file name.  No line numbers.  I've checked through all the
involved files for stupid mistakes, but I don't see any.

So what's it talking about?

Owen


begin 0644 tree.zip

M$?,[0%5X!`#H

MUO#JQFF
M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=FUZ60UM AE72C9'TK9=>:C%:)(
MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=18'1/&*,4&NE.+
M;UJL(=6\UX0ES/'2#ETW

M=L"5NM-&KG"XR'[`U%=D!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=I]\VVQ::_CF2ZI
M,[[6=%LB50\&NI$Q$63=EIM1?;\P7P[Q=-8WY&GXCS0[_7PHZ:;0 VWZ&[ZX


MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
M8/<%0AZ_\P6ME*D=X)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=*^38`6J"Q$6\$,,%,Y!'MRW]I6`
MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=K#CCY

MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

MQ443>)EY\[VIIC8H!'EN+)F=)*WC9:C%DG.\=60]2-4X!X>H%;6`!^>LL^11

M^N*R:3-200543N\\X;[D#V
MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
M+'/05#XZ
M````I($`````=&5S="YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
M964N9%54!0`#CR
M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

`
end
Feb 24 2004
parent reply resistor mac.com writes:
What I don't understand is that the same technique worked in other classes (cf.
Queue and Stack in my 
Charon package).  Is the compiler applying the rules inconsistantly?  Or is
there something specific 
about them that makes them excused?

Owen

In article <c1hh99$g6v$1 digitaldaemon.com>, larry cowan says...
It appears that your independent compiles do not actually force an instantiation
of any templates until your test.d does so, then in trying to instantiate a
BinaryTree there, the first one hit is Tree which is a class not a template.
(Since BinaryTree is also a class rather than a template, I don't know why it
didn't complain there first.  It must be trying to build from the ground up in
some sense.) To create an instance of a class object you use 'new', but for what
I think you're trying to do you should be defining templates rather than
classes.  Not a lot of change to your code actually.

Send me an email at larrycowan comcast.net and I'll reply with some sample code.

In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says...
Just in case this attachment didn't work either, it's also at
http://fortytwo.athensacademy.net/tree.zip

In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says...
OK, another template question.

I've attached the files illustrating the error.

I keep getting an error saying:
"template instance Tree!(int) Tree is not a template declaration"

That's it.  No file name.  No line numbers.  I've checked through all the
involved files for stupid mistakes, but I don't see any.

So what's it talking about?

Owen


begin 0644 tree.zip

M$?,[0%5X!`#H

MUO#JQFF
M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=FUZ60UM AE72C9'TK9=>:C%:)(
MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=18'1/&*,4&NE.+
M;UJL(=6\UX0ES/'2#ETW

M=L"5NM-&KG"XR'[`U%=D!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=I]\VVQ::_CF2ZI
M,[[6=%LB50\&NI$Q$63=EIM1?;\P7P[Q=-8WY&GXCS0[_7PHZ:;0 VWZ&[ZX


MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
M8/<%0AZ_\P6ME*D=X)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=*^38`6J"Q$6\$,,%,Y!'MRW]I6`
MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=K#CCY

MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

MQ443>)EY\[VIIC8H!'EN+)F=)*WC9:C%DG.\=60]2-4X!X>H%;6`!^>LL^11

M^N*R:3-200543N\\X;[D#V
MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
M+'/05#XZ
M````I($`````=&5S="YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
M964N9%54!0`#CR
M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

`
end
Feb 25 2004
parent reply larry cowan <larry_member pathlink.com> writes:
Nowhere in your charon.zip or tree.zip is the word 'template' which is needed in
the definition of one.  Yet you are using templated typing constructs.  (You
also have no 'instance's directly defined in your test.d.) Why do you say you
are using templates?  What was your test.d for the Queue and Stack things?

-larry

In article <c1i4eg$1haa$1 digitaldaemon.com>, resistor mac.com says...
What I don't understand is that the same technique worked in other classes (cf.
Queue and Stack in my 
Charon package).  Is the compiler applying the rules inconsistantly?  Or is
there something specific 
about them that makes them excused?

Owen

In article <c1hh99$g6v$1 digitaldaemon.com>, larry cowan says...
It appears that your independent compiles do not actually force an instantiation
of any templates until your test.d does so, then in trying to instantiate a
BinaryTree there, the first one hit is Tree which is a class not a template.
(Since BinaryTree is also a class rather than a template, I don't know why it
didn't complain there first.  It must be trying to build from the ground up in
some sense.) To create an instance of a class object you use 'new', but for what
I think you're trying to do you should be defining templates rather than
classes.  Not a lot of change to your code actually.

Send me an email at larrycowan comcast.net and I'll reply with some sample code.

In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says...
Just in case this attachment didn't work either, it's also at
http://fortytwo.athensacademy.net/tree.zip

In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says...
OK, another template question.

I've attached the files illustrating the error.

I keep getting an error saying:
"template instance Tree!(int) Tree is not a template declaration"

That's it.  No file name.  No line numbers.  I've checked through all the
involved files for stupid mistakes, but I don't see any.

So what's it talking about?

Owen


begin 0644 tree.zip

M$?,[0%5X!`#H

MUO#JQFF
M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=FUZ60UM AE72C9'TK9=>:C%:)(
MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=18'1/&*,4&NE.+
M;UJL(=6\UX0ES/'2#ETW

M=L"5NM-&KG"XR'[`U%=D!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=I]\VVQ::_CF2ZI
M,[[6=%LB50\&NI$Q$63=EIM1?;\P7P[Q=-8WY&GXCS0[_7PHZ:;0 VWZ&[ZX


MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
M8/<%0AZ_\P6ME*D=X)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=*^38`6J"Q$6\$,,%,Y!'MRW]I6`
MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=K#CCY

MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

MQ443>)EY\[VIIC8H!'EN+)F=)*WC9:C%DG.\=60]2-4X!X>H%;6`!^>LL^11

M^N*R:3-200543N\\X;[D#V
MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
M+'/05#XZ
M````I($`````=&5S="YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
M964N9%54!0`#CR
M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

`
end
Feb 25 2004
parent reply C <dont respond.com> writes:
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.
Thats the old style, the new style is class Node(T) { ... } Hes using templates.
 no 'instance's directly defined in your test.d.
Also old style , new template instanstiaion is Node!(int) myNode =3D new Node!(int); Sorry cant help with the problem, let us know what the fix was please. C On Wed, 25 Feb 2004 16:19:10 +0000 (UTC), larry cowan = <larry_member pathlink.com> wrote:
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.  Yet you are using templated typing constructs.=
=
 (You
 also have no 'instance's directly defined in your test.d.) Why do you =
 say you
 are using templates?  What was your test.d for the Queue and Stack =
 things?

 -larry

 In article <c1i4eg$1haa$1 digitaldaemon.com>, resistor mac.com says...=
 What I don't understand is that the same technique worked in other =
 classes (cf.
 Queue and Stack in my
 Charon package).  Is the compiler applying the rules inconsistantly? =
=
 Or is
 there something specific
 about them that makes them excused?

 Owen

 In article <c1hh99$g6v$1 digitaldaemon.com>, larry cowan says...
 It appears that your independent compiles do not actually force an =
 instantiation
 of any templates until your test.d does so, then in trying to =
 instantiate a
 BinaryTree there, the first one hit is Tree which is a class not a =
 template.
 (Since BinaryTree is also a class rather than a template, I don't kn=
ow =
 why it
 didn't complain there first.  It must be trying to build from the =
 ground up in
 some sense.) To create an instance of a class object you use 'new', =
 but for what
 I think you're trying to do you should be defining templates rather =
 than
 classes.  Not a lot of change to your code actually.

 Send me an email at larrycowan comcast.net and I'll reply with some =
 sample code.

 In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says..=
.
 Just in case this attachment didn't work either, it's also at
 http://fortytwo.athensacademy.net/tree.zip

 In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says.=
..
 OK, another template question.

 I've attached the files illustrating the error.

 I keep getting an error saying:
 "template instance Tree!(int) Tree is not a template declaration"

 That's it.  No file name.  No line numbers.  I've checked through =
 all the
 involved files for stupid mistakes, but I don't see any.

 So what's it talking about?

 Owen


 begin 0644 tree.zip

 M$?,[0%5X!`#H

 MUO#JQFF<L/AQB7B'8?=3DN][U=3DA:Y%%%;"+2I=3D\9N%3<PP.+6+*ZXS/.`)4$L=
 M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

 M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=3DFUZ60UM AE72C9'TK9=3D>:C%:)(
 MDJ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``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

 `
 end
-- = Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 25 2004
parent reply larry cowan <larry_member pathlink.com> writes:
I stand corrected.  I have done most of my stuff from an old pdf version of the
manual.  Just printed out the website pages for a newer reference.  Will look
into the problem more.


In article <opr3xwypn2ehmtou localhost>, C says...
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.
Thats the old style, the new style is class Node(T) { ... } Hes using templates.
 no 'instance's directly defined in your test.d.
Also old style , new template instanstiaion is Node!(int) myNode =3D new Node!(int); Sorry cant help with the problem, let us know what the fix was please. C On Wed, 25 Feb 2004 16:19:10 +0000 (UTC), larry cowan = <larry_member pathlink.com> wrote:
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.  Yet you are using templated typing constructs.=
=
 (You
 also have no 'instance's directly defined in your test.d.) Why do you =
 say you
 are using templates?  What was your test.d for the Queue and Stack =
 things?

 -larry

 In article <c1i4eg$1haa$1 digitaldaemon.com>, resistor mac.com says...=
 What I don't understand is that the same technique worked in other =
 classes (cf.
 Queue and Stack in my
 Charon package).  Is the compiler applying the rules inconsistantly? =
=
 Or is
 there something specific
 about them that makes them excused?

 Owen

 In article <c1hh99$g6v$1 digitaldaemon.com>, larry cowan says...
 It appears that your independent compiles do not actually force an =
 instantiation
 of any templates until your test.d does so, then in trying to =
 instantiate a
 BinaryTree there, the first one hit is Tree which is a class not a =
 template.
 (Since BinaryTree is also a class rather than a template, I don't kn=
ow =
 why it
 didn't complain there first.  It must be trying to build from the =
 ground up in
 some sense.) To create an instance of a class object you use 'new', =
 but for what
 I think you're trying to do you should be defining templates rather =
 than
 classes.  Not a lot of change to your code actually.

 Send me an email at larrycowan comcast.net and I'll reply with some =
 sample code.

 In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says..=
.
 Just in case this attachment didn't work either, it's also at
 http://fortytwo.athensacademy.net/tree.zip

 In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says.=
..
 OK, another template question.

 I've attached the files illustrating the error.

 I keep getting an error saying:
 "template instance Tree!(int) Tree is not a template declaration"

 That's it.  No file name.  No line numbers.  I've checked through =
 all the
 involved files for stupid mistakes, but I don't see any.

 So what's it talking about?

 Owen


 begin 0644 tree.zip

 M$?,[0%5X!`#H

 MUO#JQFF<L/AQB7B'8?=3DN][U=3DA:Y%%%;"+2I=3D\9N%3<PP.+6+*ZXS/.`)4$L=
 M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

 M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=3DFUZ60UM AE72C9'TK9=3D>:C%:)(
 MDJ:[2*6C6"\KBN&7B[7%,$!N\GF>PA%>3/2)EC\)NRBIL=3D18'1/&*,4&NE.+
 M;UJL(=3D6\UX0ES/'2#ETW
^

 M=3DL"5NM-&KG"XR'[`U%=3DD!HI*SS!DF9]90!P84*A'U?N4PU*C:Y>7SV&W-SN\
 M/"0V?H,J++VU?+>]N'%;_FS.VF!80FQQ8_Z;!V#Q&0BLC=3DI]\VVQ::_CF2ZI
 M,[[6=3D%LB50\&NI$Q$63=3DEIM1?;\P7P[Q=3D-8WY&GXCS0[_7PHZ:;0 VWZ&[Z=
X


 MT)N;;/R`VE[Z`;W46],#PK.2(!B$;3>-_UX0H2XU:6IB-,R;F3<^WJ"8%8!I
 M3[22%57#X#XMET1?C0:HBX(/H](F8ZPU^`PU0:8)/RVJQE7*YH2_"C1J98`:
 M8/<%0AZ_\P6ME*D=3DX)Z+X P3QIX5<YI(H%9KD.:,$R+APU-.3H*X]-:+',W^
 MI:S)D%:Q:X`0[W"Y^F$^86F%6%P0BNAC=3D*^38`6J"Q$6\$,,%,Y!'MRW]I6`
 MSKS8UD\F:X7V*%E?!&*"E6YZ/E5Q+#O
 M/F>IXGT4**R)WP)O4AZXQQ^O8-% +D=3DK#CCY

 MX0```,<"```4`!4`8VAA<F]N+V-O;6UO;B]N;V1E+F155`D``VP2/$#CT#M`

:U%
 MQ443>)EY\[VIIC8H!'EN+)F=3D)*WC9:C%DG.\=3D60]2-4X!X>H%;6`!^>LL^11

 M^N*R:3-200543N\\X;[D#V
 MUY%^`Y 3Q4C#Y*]H6P7TD;K(]B:6[%)A8_]87,9M E+;XVOPJ#NH%FO+?F+J
 M+'/05#XZ
 M````I($`````=3D&5S=3D"YD550%``-P)#Q`57 ``%!+`0(7`Q0````(`` B63!M
 MB)9N5`$``'8%```4``T```````$```"D ;$```!C:&%R;VXO8V]M;6]N+W1R
 M964N9%54!0`#CR
 M& `-```````!````I(%,` ``8VAA<F]N+V-O;6UO;B]B:6YA<GET<F5E+F15

 M`````0```*2!S`,``&-H87)O;B]C;VUM;VXO;F]D92YD550%``-L$CQ`57 `

 `
 end
-- = Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 25 2004
parent resistor mac.com writes:
My test for Queue and Stack went something like this:
Queue!(char[]) mine = new Queue!(char[])();
mine.push("Hello world!");
printf(mine.pop());

And it worked just fine.  What's so different about Tree and BinaryTree?

Owen

P.S. To whoever wanted ternary tree: I'm looking into adding support for a
pretty diverse set of tree types, probably including ternary trees.  I'm also
planning to make an subclass of the BinaryTree for RedBlackTree.  Of course,
that assumes I get BinaryTree working in the first place.

In article <c1incm$2jb0$1 digitaldaemon.com>, larry cowan says...
I stand corrected.  I have done most of my stuff from an old pdf version of the
manual.  Just printed out the website pages for a newer reference.  Will look
into the problem more.


In article <opr3xwypn2ehmtou localhost>, C says...
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.
Thats the old style, the new style is class Node(T) { ... } Hes using templates.
 no 'instance's directly defined in your test.d.
Also old style , new template instanstiaion is Node!(int) myNode =3D new Node!(int); Sorry cant help with the problem, let us know what the fix was please. C On Wed, 25 Feb 2004 16:19:10 +0000 (UTC), larry cowan = <larry_member pathlink.com> wrote:
 Nowhere in your charon.zip or tree.zip is the word 'template' which is=
=
 needed in
 the definition of one.  Yet you are using templated typing constructs.=
=
 (You
 also have no 'instance's directly defined in your test.d.) Why do you =
 say you
 are using templates?  What was your test.d for the Queue and Stack =
 things?

 -larry

 In article <c1i4eg$1haa$1 digitaldaemon.com>, resistor mac.com says...=
 What I don't understand is that the same technique worked in other =
 classes (cf.
 Queue and Stack in my
 Charon package).  Is the compiler applying the rules inconsistantly? =
=
 Or is
 there something specific
 about them that makes them excused?

 Owen

 In article <c1hh99$g6v$1 digitaldaemon.com>, larry cowan says...
 It appears that your independent compiles do not actually force an =
 instantiation
 of any templates until your test.d does so, then in trying to =
 instantiate a
 BinaryTree there, the first one hit is Tree which is a class not a =
 template.
 (Since BinaryTree is also a class rather than a template, I don't kn=
ow =
 why it
 didn't complain there first.  It must be trying to build from the =
 ground up in
 some sense.) To create an instance of a class object you use 'new', =
 but for what
 I think you're trying to do you should be defining templates rather =
 than
 classes.  Not a lot of change to your code actually.

 Send me an email at larrycowan comcast.net and I'll reply with some =
 sample code.

 In article <c1hb5o$5tu$1 digitaldaemon.com>, resistor mac.com says..=
.
 Just in case this attachment didn't work either, it's also at
 http://fortytwo.athensacademy.net/tree.zip

 In article <c1h8o5$18t$1 digitaldaemon.com>, resistor mac.com says.=
..
 OK, another template question.

 I've attached the files illustrating the error.

 I keep getting an error saying:
 "template instance Tree!(int) Tree is not a template declaration"

 That's it.  No file name.  No line numbers.  I've checked through =
 all the
 involved files for stupid mistakes, but I don't see any.

 So what's it talking about?

 Owen


 begin 0644 tree.zip

 M$?,[0%5X!`#H

 MUO#JQFF<L/AQB7B'8?=3DN][U=3DA:Y%%%;"+2I=3D\9N%3<PP.+6+*ZXS/.`)4$L=
 M!!0````(`` B63!MB)9N5`$``'8%```4`!4`8VAA<F]N+V-O;6UO;B]T<F5E

 M1&!;D`!'QO2A*O]>KVW`6`2I30Z`-;N>V=3DFUZ60UM AE72C9'TK9=3D>:C%:)(
 MDJ:[2*6C6"\KBN&7B[7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XO;F]D92YD550%``-L$CQ`57 `

 `
 end
-- = Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 25 2004