std::vector, std::list, or if using C++11, std::forward_list). The core problem is that std::queue is not meant to be iterated over. You can have a look at the documentation. Although std::queue doesn't support iteration, it does have a copy constructor which allows us to transfer the contents of a temporary copy of the queue to another temporary container that would support iteration (e.g. Well, the answer is actually pretty simple: there is no function begin () in std::queue and there isn't any overload of std::begin taking a std::queue either.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |