Method header and attributes

Hi,

I'm trying to understand a portion of code made with template.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 --
Okay !! Thanks a lot, solved my problem :)
Topic archived. No new replies allowed.