You have several options; if you really need a stack, you can use std::stack from STL. Just include #import <stack> rename any .m files that use it in .mm .
Another option is to write an Objective-C class that either wraps std::stack or provides the NSMutableArray stack NSMutableArray . I include this, despite your wishes to the contrary, because if you really havenβt profiled the code that NSMutableArray uses, you have absolutely no business complaining about its performance.
source share