Boost logo

Boost :

Subject: Re: [boost] GSoC 2010: Heaps and Queues
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-04-08 18:02:02


> > 2. Let the use update the modified value on their own. This means that
> heap
> > will, for a short time, be invalid, but there aren't any complex side
> > effects until the programmer invokes them.
>

> mentioned above. Do you mean postponing the work for later operations?
> Which
> means change the key in heap but not heapify them until some operation
> (such
> as insertion) is called?
>

If the programmer is going to modify an "en-heaped" object (an object that's
been put into a heap), then they would need to update the heap before
calling any other modifying operations.

Maybe this approach allows too much freedom. I suppose you could also offer
a method:

  void update(iterator pos, const T& x); // *pos = x; update(pos);

That would prevent modifying operations in between updates.

Andrew Sutton
andrew.n.sutton_at_[hidden]


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