Boost logo

Boost :

Subject: Re: [boost] [GSoC] Heaps & Queues (draft proposal)
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-04-02 17:48:08


Just a couple of technical points.

> * void update(T* t, T& new_key);*
>

What if T is non-copyable, doesn't support efficient copies, or the user
only wants to update part of t? I don't think that this is quite the right
solution.

And I would prefer to use lists rather than vectors (as shown in
> boost/pending/fibonacci_heap.hpp) to implement it for three reasons.
> 1. It will save memory since the later needs extra space to store
> the key to value mapping.
> 2. Vector requires continuous memory while list doesn’t. It does not
> matter when the amount of data is small. But when the amount of data
> becomes
> large, it will be a tough problem;
> 3. It takes time to resize and reallocate the memory for vectors.
>

Why not allow the user select the underlying container type?

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