From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6309 invoked by alias); 8 May 2002 18:46:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6279 invoked by uid 71); 8 May 2002 18:46:02 -0000 Date: Wed, 08 May 2002 11:46:00 -0000 Message-ID: <20020508184602.6278.qmail@sources.redhat.com> To: gdr@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: libstdc++/3552: missing hash function for std::string Reply-To: Phil Edwards X-SW-Source: 2002-05/txt/msg00239.txt.bz2 List-Id: The following reply was made to PR libstdc++/3552; it has been noted by GNATS. From: Phil Edwards To: Goswin Brederlow Cc: Vadim Ogranovich , "'gcc-gnats@gcc.gnu.org'" , "'Laurent.Bonnaud@inpg.fr'" , "'87063-quiet@bugs.debian.org'" <87063-quiet@bugs.debian.org>, "'gcc-bugs@gcc.gnu.org'" Subject: Re: libstdc++/3552: missing hash function for std::string Date: Wed, 8 May 2002 14:38:48 -0400 On Wed, May 08, 2002 at 07:01:45PM +0200, Goswin Brederlow wrote: > > Yes. How can we possibly guess what a good hash function would be for > > arbitrary strings? Efficiency of hashing is extremely dependant on the > > data being hashed. You need to write one that's appropriate for your data; > > this will involve multiple experiments. > > > > There is std::collate::hash() for char*'s, but this is essentially a > > generic guess, and should only be used when you haven't yet had the time > > to come up with a more appropriate function. > > Having one for char* but not for string is a bit of a contradiction. I'd like to remove the one for char*, actually... The implementation of hashing currently being proposed for C++0x apparently uses a completely different interface. I'd rather just improve the (eventual) standard version, rather than kicking along the extensions that we inherited. Phil -- If ye love wealth greater than liberty, the tranquility of servitude greater than the animating contest for freedom, go home and leave us in peace. We seek not your counsel, nor your arms. Crouch down and lick the hand that feeds you; and may posterity forget that ye were our countrymen. - Samuel Adams