I would like to use the generic queue class as described in the .NET framework (3.5)
but I will need a Remove(int index) method to remove items from the queue. Can I achieve this functionality with an extension method? Anyone care to point me in the right direction?
C# Adding a Remove(int index) method to the .NET Queue class
c++queue
Related Question
- C# – Simple insecure two-way data “obfuscation”
- C# – Nullable type as a generic parameter possible
- C# – How to clone a range of array elements to a new array
- C# – Distinct() with lambda
- C# – Passing a single item as IEnumerable
- C# – Group by in LINQ
- C# – Entity Framework 5 Updating a Record
- C# – Why not inherit from List
Best Solution
What you want is a
List<T>
where you always callRemoveAt(0)
when you want to get the item from theQueue
. Everything else is the same, really (callingAdd
would add an item to the end of theQueue
).