template<class T>
class Stack{
public:
Stack();
~Stack();
bool stackItem( const T& ); //Here is my problem
bool unstackItem( T& ); //Here again
T getTop();
bool isEmpty() const;
bool isFull() const;
private:
int size_
int top_;
T *stackPtr_;
T items_[];
};
I don't understant how you can declare a methode with parameter without actually specifying the parameter name (like (int&)).
Since that's only the declaration, there's no need for a parameter name since it won't be used.
You can also have unnamed parameters in the function definition ( but that would be quite a pointless parameter )
An unnamed parameter is used to distinguish prefix and postfix ++ and --