这行代码出现“字段未解析错误”:
template <class Object>
void FHlist<Object>::pop_back()
{
Node *p;
// safer, but a little slower with this test
if ( mSize == 0 )
return;
p = mTail->prev;
mTail->prev = p->prev; // ERROR IS HERE
mTail->prev->next = mTail;
delete p;
mSize--;
}
这是我的节点类声明:
template <class Object>
class FHlist<Object>::Node
{
public:
Node *prev, *next;
Object data;
Node( const Object & d = Object(), Node *prv = NULL, Node *nxt = NULL )
: prev(prv), next(nxt), data(d)
{ }
};
为什么我会收到此错误,我将如何解决?