i'm having truble with deleting my template
my template and distructor :
template<class S, class T>
class Consortium
{
private :
map<const S, Node<T>*> m_consortiumMap;
Heap<T>m_consortiumHeap;
public :
~Consortium();
void Insert(const S key, T toAdd);
void Update(const S key);
void Remove(const S key);
const T Top();
};
template<class S, class T>
Consortium<S,T>::~Consortium()
{
m_consortiumMap.clear();
delete &m_consortiumHeap.;
}
my heap and distructor :
template <class T>
class Heap
{
private :
vector<Node<T>*> m_heapVector;
public :
~Heap();
int parent(int i) const {return i / 2;}
int left(int i) const {return 2 * i;}
int right(int i) const {return 2 * i + 1;}
void heapify(int index);
Node<T>* extractMin ();
void heapDecreaseKey (int index, Node<T>* key);
void MinHeapInsert (Node<T>* key);
Node<T>* ExtractNode(int index);
Node<T>* top ()const {return m_heapVector[0];}
};
template<class T>
Heap<T>::~Heap()
{
for (int i = 0 ; i < m_heapVector.size() ; i++)
m_heapVector.erase(m_heapVector.begin() + i);
}
and this is the object that holds the template, i'm having problems with him too
class Garage
{
private :
Consortium<string, Vehicle*> m_consortium;
public :
~Garage() {delete &m_consortium;}
};
what's wrong here?