Using a single std::string buffer for a command queue is inefficient. Every time a substring is removed from the beginning of the buffer, the entire remaining buffer needs to be copied in memory. When a command is added to the end and it doesn't fit in the existing buffer space, then a new string needs to be allocated, the old string copied to it, and the old string deallocated.

The std::queue container is built exactly for this purpose:

```
std::queue<std::string> commandQueue;
```

Use the push_back() method to add a new std::string to the end of the queue and the pop_front() method to remove the next command from the front of the queue. http://www.cplusplus.com/reference/queue/queue/