Y
yatko
Hi all;
I want to write a template class that uses STL list class and behaves
as circular list. But when I try to define an iterator the compiler
gives the following error. I really don't understand what I am doing
wrong.
Thanks
yatko
Error:
Multiple markers at this line
- type 'std::list<CircularList<DataType>::Node,
std::allocator<CircularList<DataType>::Node> >' is not derived from
type 'CircularList<DataType>'
- expected ';' before 'popIterator'
template < class DataType>
class CircularList
{
public:
...
private:
struct Node
{
DataType *dataptr;
bool valid;
};
list< Node > linear;
list < Node >::iterator popIterator;
..
};
I want to write a template class that uses STL list class and behaves
as circular list. But when I try to define an iterator the compiler
gives the following error. I really don't understand what I am doing
wrong.
Thanks
yatko
Error:
Multiple markers at this line
- type 'std::list<CircularList<DataType>::Node,
std::allocator<CircularList<DataType>::Node> >' is not derived from
type 'CircularList<DataType>'
- expected ';' before 'popIterator'
template < class DataType>
class CircularList
{
public:
...
private:
struct Node
{
DataType *dataptr;
bool valid;
};
list< Node > linear;
list < Node >::iterator popIterator;
..
};