John Bolter
asked on
Create a List<sometype> of a certain size
Hi, I am writing to ask if anyone knows of an existing .Net framework 4.5 class that allows a list of a certain size, and when the size is exceeded, it just drops off/loses one off the end keeping the most recent items.
For example
I could easily roll my own, but I don't want to do this if it is already provided by .Net
For example
SomeListClass<int> slc = new SomeListClass<int>(3); //can contain only 3 items
slc.Add(1); //list contains 1
slc.Add(2); //list contains 1,2
slc.Add(3); //list contains 1, 2, 3
slc.Add(4); //list contains 2, 3, 4
slc.Add(100);//list contains 3, 4, 100
I could easily roll my own, but I don't want to do this if it is already provided by .Net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm 99% sure that you'll have to roll your own.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone. This has all been so helpful.
I have a lot to learn !!
I have a lot to learn !!