typename error

this is probably something super simple; this line is generating the error
im pretty sure it just needs 'typename' or 'Item' somewhere but i cant figure it out. If any one could help it would be appreciated.

 
sequence<Item>::Item sequence<Item>::current() const


hw\sequence4.template [Error] need 'typename' before 'main_savitch_6B::sequence<Item>::Item' because 'main_savitch_6B::sequence<Item>' is a dependent scope
The error is explicitly telling you what is needed and where.
i thought it was telling me;


typename sequence<Item>::Item sequence<Item>::current() const

but that doesn't work what am i missing?
may be template <class Item> Item sequence<Item>::current() const ?
Why not simply Item current() const into the declaration of template ?
1
2
3
4
5
6
7
8
9
template <class Item>
class sequence
{
public:
	Item current() const
	{
		//return an Item
	}
};
Topic archived. No new replies allowed.