STL usage in C#

DigitalCyborg

09-04-2006 01:51:08

Hi.

I'm looking at Intermediate tutorial 1 and I'm trying to correlate the stuff in the STL with the stuff in .NET.

I'm sorry for the n00b question, but C# is new to me. If looked around a little and couldn't find much.. If you know where I can find the answer, even if its RTFM : http://www.ogre3d.org/<WHERE_I_SHOULD_LOOK)

Is there a C# implementation of the stuff in the STL?

Thanks

DC

DigitalCyborg

09-04-2006 02:00:41

OK so I found some stuff in System.Collections and Systems.Collections.Generic

http://msdn2.microsoft.com/en-us/library/0sbxh9x2(vs.80).aspx

now, which one has the same properties as the deque.

LOL

the_cX

09-04-2006 03:29:32

@DigitalCyborg:

when you say properties of a deque, are you making reference to the front and back pushing/popping functionality? or just idea of a dynamic type array?

i ask because i know some people use a deque because thats the first thing they might have learned. there really is no equivalent System.Collections class to std::deque, but System.Collections.ArrayList and System.Collections.Stack are pretty close to std::vector, and System.Collections.Hashtable can do anything an std::map can.

you can check the msdn for examples of any of those, but if you still need help then post.

DigitalCyborg

09-04-2006 03:59:04

Actually,

I'm trying to stay as close to the CPP version of the tutorial as possible.

I think I found what I was looking for in System.Collections.Generic:

LinkedList<T>

the C# LinkedList is a doubly linked list which allows addition to the front and back.

I'm using it as follows

LinkedList<Vector3> mWalkList = null;

...
//Constructor
public MoveDemoApplication()
{
mWalkList = new LinkedList<Vector3>();
}
...


If it doesn't work I'll let you know. :wink:

DC