I'd like to use a C++ stack type in Objective-C, but I'm running into some issues. Here's a sample of what I would like to do:
#import <stack>
#import <UIKit/UIKit.h>
@interface A : NSObject {
stack<SEL> selectorStack;
}
@end
Unfortunately, this doesn't compile. After messing around with the code for a while and trying different things, I can't seem to find a way to accomplish this. Can somebody tell me the best way to use a C++ stack within an Objective-C object or if it's even possible?
Thanks.
UPDATE:
Well, KennyTM's answer worked on my example file, but for some reason when I tried to rename the class it quit working. Here's the code I have right now:
#import <stack>
#import <UIKit/UIKit.h>
@interface MenuLayer : NSObject {
std::stack<SEL> selectorStack;
}
@end
The compiler spits out the following errors:
stack: No such file or directory
expected specifier-qualifier-list before 'std'