linked list
linked list
hi . im working on a world editor ,want to keep all my objects in multiple lists. irrlicht has a double link list class ,what i want to know is how to use it ,to be more specific i dnt know how to create it .
compulsive compiler
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: linked list
Can you be a bit more specific? Are you having problems with the basic issue of templated classes, or with the specific usage of irr::core::list?Johan wrote:to be more specific i dnt know how to create it .
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Like almost all other templated container classes (like STL)....
All templated classes work like this. They may require additional template parameters, but this gives you the jist.
From then on, use them like any other normal class.
Code: Select all
//For a list of ints
irr::core::list<int> mylist;
//For a list of floats
irr::core::list<float> mylist;
//For a list of some random class
irr::core::list<MyRandomClass> mylist;
//Hey, you can even do pointers
irr::core::list<MyRandomClass*> mylist;
From then on, use them like any other normal class.
Code: Select all
mylist.doSomething();
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
How about you open your kimono and show us your dangling pointers?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
rogerborg ,even when i try the exact code example he gave me i get that error so its not specific to my own code ,problem with compiler settings? i read something that the problem could come from optimization options .. il look into it sometime but for now im sorted out ,just using my own linked list class .thanx for your support
compulsive compiler
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
OK, but you'll still have a compiler problem waiting to bite you. Your DE, your rules though.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Without knowing the exact error, I will never be able to help you more. I'll also need to know what compiler/IDE you are using. If I remember right, msvc 2003 didn't support templates at all.error message -internal compiler error .
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
i would realy love to know exactly what the error is but supposedly the compiler gives you internal compiler error before it can evaluate what causes it so your left with just that message .i use msvc 6 on windows xp pro ,do u think that there might be diffrent compile settings on msvc 6? i did read about the error message and what could cause it ,basicly could have multiple causes ,but what i dnt get is that all other templated classes work .just as soon as i try creating the list class do i get that error.
compulsive compiler