Does std::stack expose iterators?

Stack does not have iterators, by definition of stack. If you need stack with iterators, you’ll need to implement it yourself on top of other container (std::list, std::vector, etc).
Stack doc is here.

P.S. According to a comment i got from Iraimbilanja, std::stack by default uses std::deque for implementation.

Leave a Comment