Code: template <class T> class BasicMinMaxHeap { public: void insert(const T& elt);} -------------------------------------- template <class T> void BasicMinMaxHeap<T>::insert(const T& elt) { if(lastindex == maxsize) grow(); cerr << "insert: " << elt << endl; lastindex++; A[lastindex] = elt; bubbleUp(lastindex); } void main(){ // if i want to call the above insert function, what is the statement look like?? <--------- Question }

You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum.

Try this out.. Code: class SomeClass { }; void main() { BasicMinMapHeap<int> integer_heap; BasicMinMapHeap<SomeClass> SomeClass_heap; SomeClass obj; integer_heap.insert(3); integer_heap(10); SomeClass_heap.insert(object); } Correct me if I am wrong somewhere.. | Dharma |