Boost logo

Boost :

Subject: Re: [boost] GSoC 2010: Heaps and Queues
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-04-08 23:37:02


AMDG

Dan Larkin wrote:
> template <class T, class Compare = std::less<T>>
> class Heap {
>
> public:
>
> virtual iterator& insert( T* elem ) = 0;

Maybe I missed something but why pure virtual functions?

> virtual void remove( iterator& elem ) = 0;
> virtual void update( iterator& elem ) = 0;

Why is the iterator passed by non-const reference?

> virtual iterator& findMin() = 0;
> virtual void removeMin() = 0;

top and pop would be more consistent with
std::priority_queue.

> <snip>
> virtual iterator& begin() = 0;
> virtual iterator& end() = 0;

How can these possible return a /reference/ to an iterator?

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk