Bug 6222 - HashMap does not work with const pointer keys or values
Summary: HashMap does not work with const pointer keys or values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-23 17:56 PST by Maciej Stachowiak
Modified: 2005-12-24 14:09 PST (History)
0 users

See Also:


Attachments
the fix (4.25 KB, patch)
2005-12-23 18:00 PST, Maciej Stachowiak
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2005-12-23 17:56:14 PST
HashMap does not work for const foo * keys and values because the pointer specialization fails to cast 
away const and so fails some implicit conversions.
Comment 1 Maciej Stachowiak 2005-12-23 18:00:08 PST
Created attachment 5253 [details]
the fix
Comment 2 Eric Seidel (no email) 2005-12-24 02:42:55 PST
Comment on attachment 5253 [details]
the fix

the KDE folks have been removing c-style casts from the kxmlcore code they
imported from us.  This just gives them more to remove.

That said, this looks fine.  r=me.
Comment 3 Maciej Stachowiak 2005-12-24 14:03:52 PST
I think if you're going to const_cast and reinterpret_cast both, then you may as well just use a C-style cast.