Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Templates

Author
Message
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 17th May 2008 07:18
okay so im making a linked lists class for use in my Gimmick Game engine( a compliation of dark gdk into new/more commants) and im having an issue with templates (im new to templates) heres my source:



and i get the following error output when i compile:

Quote: "1>------ Build started: Project: nodes, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>e:\nodes\nodes\main.cpp(25) : error C2955: 'linked_list' : use of class template requires template argument list
1> e:\nodes\nodes\main.cpp(14) : see declaration of 'linked_list'
1>e:\nodes\nodes\main.cpp(25) : error C2955: 'linked_list' : use of class template requires template argument list
1> e:\nodes\nodes\main.cpp(14) : see declaration of 'linked_list'
1>e:\nodes\nodes\main.cpp(26) : error C2509: '{ctor}' : member function not declared in 'linked_list'
1> e:\nodes\nodes\main.cpp(14) : see declaration of 'linked_list'
1>Build log was saved at "file://e:\nodes\nodes\Debug\BuildLog.htm"
1>nodes - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
"


Your signature has been erased by a mod - please reduce it to 600x120
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 17th May 2008 21:25
please help as it stands my data structure works, but since i cant use templates for the time being each node stores like 3 data types, each node takes 17 bytes!

Your signature has been erased by a mod - please reduce it to 600x120
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 17th May 2008 22:27 Edited at: 17th May 2008 22:27
Post up the code, and I will get you going, this one is a very complex and advanced topic in software engineering. (Class design for templates and also using templates.)
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 17th May 2008 22:37
okay they are big here they are:

list.h

list.cpp


as you can see, in my data class ive included a value for alot of data types, which vastly increases memory consumption. but everytime i try to template it, even just define the constructor, i get about 2 errors, one on its signature, one on the opening bracket. please help

Your signature has been erased by a mod - please reduce it to 600x120
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 17th May 2008 23:02
Actually, IanM has a very good answer for you in your other thread in Programming Talk. Just let this one die off, and continue in the other one, okay?
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 17th May 2008 23:21
you got it, technically this one was in the wrong place anyways, it dosent really deal with GDK at all.

Your signature has been erased by a mod - please reduce it to 600x120
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th May 2008 19:18
bah - I ask C++ questions here - its germain

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 19th May 2008 19:23
No wonder I had trouble learning C++. German is a foreign language and I'm bad at foreign languages.

What?
GermaIn?
Well, that's different.

Never mind.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th May 2008 19:25
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 20th May 2008 22:11
-is exponentially confused-

Your signature has been erased by a mod - please reduce it to 600x120

Login to post a reply

Server time is: 2024-09-29 21:28:35
Your offset time is: 2024-09-29 21:28:35