sets and maps don't maintain insertion order - required to FIFO pushing/popping.  boost::multiindex could work.  For buffers with many resource objects, the check is n^2.  I think no check will be much faster than using even very fast containers.