[Freeciv-Dev] Re: (PR#12893) [PATCH] improved hash tables
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12893 >
On Tue, Apr 26, 2005 at 10:01:53AM -0700, Jason Short wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12893 >
>
> Benoit Hudson wrote:
>
> > (2) breaking constness (data and key are const; but to free them we need
> > to remove the const quals) is unfortunate; I'm not sure what the most
> > elegant solution is. This isn't a new problem: hash_replace and
> > hash_lookup_data return void* rather than const void*.
>
> Simple: data and key must not be const.
Except that then to put a const city * into the hash the user has to
cast away const.
-- Benoît
|
|