Which STL container should I use for a FIFO?

Since there are a myriad of answers, you might be confused, but to summarize: Use a std::queue. The reason for this is simple: it is a FIFO structure. You want FIFO, you use a std::queue. It makes your intent clear to anybody else, and even yourself. A std::list or std::deque does not. A list can … Read more

Fixed size queue which automatically dequeues old values upon new enques

I would write a wrapper class that on Enqueue would check the Count and then Dequeue when the count exceeds the limit. public class FixedSizedQueue<T> { ConcurrentQueue<T> q = new ConcurrentQueue<T>(); private object lockObject = new object(); public int Limit { get; set; } public void Enqueue(T obj) { q.Enqueue(obj); lock (lockObject) { T overflow; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)