STL usage in C#


09-04-2006 01:51:08


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 :<WHERE_I_SHOULD_LOOK)

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




09-04-2006 02:00:41

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

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



09-04-2006 03:29:32


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.


09-04-2006 03:59:04


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:


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;

public MoveDemoApplication()
mWalkList = new LinkedList<Vector3>();

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