I have a template class for a stack (on which I can perform push/pop operations).
If I call the doSomething()
function via
A::doSomething();
I get an "unresolved external symbol..." error message. How can I create an static stack in my class a on which I can perform push and pop operations?
class A {
private:
// stack which can hold 4 integers
static stack<int, 4> s;
public:
static void doSomething() {
s.push(4);
}
};
You can see a code snippet here: codeshare.io/arJmmY