standard library query

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

I want to use deques with/in my c# proggy,
that I learnt about in c++,
from the standard library.

I figure my options are:
a) it exisits in c# but I dunno where,
b) I cant use it in c# but need to make a c++ library
c) ... ???

many thanks
(this an incredibly helpful and speedy forum,
I hope to help folk in the same way one day)
tom
 
tom said:
I want to use deques with/in my c# proggy,
that I learnt about in c++,
from the standard library.

I figure my options are:
a) it exisits in c# but I dunno where,

It's worth being clear that C# is a language, not a platform. You're
hoping that the functionality you want is in the .NET framework itself
- which it may well be.
b) I cant use it in c# but need to make a c++ library
c) ... ???

Could you say exactly what you mean by "deques"? It's not a term I'm
familiar with.
 
I think he means "dequeue" = Double-Ended Queue. Basically a
combination of a stack and a queue -- you can push or pull elements from
either the head or the tail of the list.

And no, the Framework doesn't appear to come with a Dequeue. There's a
Stack and a Queue in System.Collections, but if you need something
that's both a stack and a queue at the same time, you'll have to code it
yourself. Should be fairly easy to do.
 
Hi Tom,

have a look at the collections namespace. ArrayList may also suit your needs. If you don't find what you need, you can easily create
your own (untyped) list, and derive a strong typed list - a thing that would be done in C++ with templates.
HTH,
ulli
 
Back
Top