Hey, I've only been using MSVC++ for a few weeks now, and I really LOVE all of the handy features, especially the ClassView tree.... however, for some reason, two member functions don't show up in the ClassView tree or in the member list... EVEN THOUGH the members function perfectly, I use them and they work..... so I don't see any reason why in the ClassView and member list they aren't there.....
Here's the code... could you tell me if there's something I've done which causes MSVC++ to do this? Because I can't figure it out......
PHP Code:
#ifndef _SLList_H
#define _SLList_H
#ifndef NULL
#define NULL 0
#endif
template <class T>
struct Node
{
Node<T>* next;
T data;
};
template <class T>
class SLList
{
private:
Node<T>* head, *curr;
int length;
public:
SLList() { head = curr = NULL; length = 0; }
~SLList() { while (length > 0) remove_back(); }
int getlength() { return length; }
void add_back(T);
void remove_back();
};
template <class T>
void SLList<T>::add_back(T data)
{
Node<T>* newNode = new Node<T>;
if (length == 0)
head = curr = newNode;
curr->next = newNode;
newNode->data = data;
newNode->next = NULL;
curr = newNode;
length += 1;
}
template <class T>
void SLList<T>::remove_back()
{
curr = head;
if (curr->next == NULL)
{
delete curr;
head = curr = NULL;
length -= 1;
return;
}
while ((curr->next)->next != NULL)
curr = curr->next;
delete (curr->next);
curr->next = NULL;
length -= 1;
}
#endif