Originally Posted by
Elysia
The later versions of MSVC handles such cases just fine.
Make sure your version is up-to-date. And we still don't know even remotely what can be causing your problem.
How does the template declaration part before the function look like?
What is the type of a_elem (I know it's T, but what type is T?)?
Is the member function gmHashNode a template member function or a normal member function inside a template class or some such?
I'm not using MSVC, I'm using the ISO compliant CodeWarrior compiler.
I'm not sure what you mean about the type of a_elem.
Thanks for your help, I've included more code so you can see what the template declaration etc. looks like:
Code:
/// \class gmListDouble
/// \brief Templated intrusive doubly linked list using a sentinal node
template <class T>
class gmListDouble
{
public:
/// \class Iterator
class Iterator
{
public:
GM_INCLUDE_ITERATOR_KERNEL(T)
inline Iterator() { m_node = NULL; m_list = NULL; }
inline Iterator(T * a_node, const gmListDouble * a_list) { m_node = a_node; m_list = a_list; }
inline void Inc() { m_node = m_list->GetNext(m_node); }
inline void Dec() { m_node = m_list->GetPrev(m_node); }
inline bool IsValid() const { return (m_list && m_list->IsValid(m_node)); }
private:
T * m_node;
const gmListDouble * m_list;
};
// methods
inline gmListDouble();
inline ~gmListDouble();
inline void InsertAfter(T * a_cursor, T * a_elem);
inline bool IsValid(const T* a_elem) const { return (a_elem != &m_sentinel); }
inline T* GetFirst() const { return (T*) m_sentinel.m_next; }
inline T* GetLast() const { return (T*) m_sentinel.m_prev; }
inline T* GetNext(const T* a_elem) const { return (T*) a_elem->gmListDoubleNode<T>::m_next; }
inline T* GetPrev(const T* a_elem) const { return (T*) a_elem->gmListDoubleNode<T>::m_prev; }
inline bool IsEmpty() const { return (m_sentinel.m_next == &m_sentinel); }
inline Iterator First(void) const { return Iterator(static_cast<T*>(m_sentinel.m_next), this); }
inline Iterator Last(void) const { return Iterator(static_cast<T*>(m_sentinel.m_prev), this); }
private:
gmListDoubleNode<T> m_sentinel;
};