Chapter     17

STL’s Stack and Queue

The STL containers you have seen so far have all provided options for storing and retrieving values and are suited to different circumstances. The stack and queue containers are designed for different reasons. Although they do store values, their behavior is much more important. I’ll show you exactly how these containers behave in this chapter.

Note  The game examples in this book don’t use these containers, but I didn’t want to leave them out. You might find a stack useful in a game where you are building a UI system and want to track the path to the current screen. I’ve also found a queue to be useful in event systems where you wish to process events in the exact order in which they were received.

The ...

Get Learn C++ for Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.