Constant-size queue?

  • Thread starter Thread starter Gabe Moothart
  • Start date Start date
G

Gabe Moothart

Hi,
I would like to use a System.Collections.Queue which is constant size -
if it is full, it should fail to add new items instead of growing
automatically. I looked at the help, and thought that a growth factor of
1.0 would do this. However, it doesn't seem to have worked. Is there any
way to keep the queue from growing?

TIA,
Gabe
 
Hi,

There doesn't appear to be a way to do this through the existing interface.

Since the Enqueue method is virtual, you could create a derived class that
overrides this method and checks the size before passing the call down to the
base class.

-- Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top