Fixes for wxHashTable when wxUSE_STL=1:

wxHashTable must work like an hash_multimap, not an hash_map.
wxHashTable::Delete is supposed to actually delete entries
more tests in console sample.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-08-19 21:17:04 +00:00
parent 8b7ac60523
commit 760d3c7cd3
3 changed files with 76 additions and 22 deletions

View File

@@ -297,6 +297,19 @@ protected: \
\
return node; \
} \
void CreateNodeLast( const value_type& value ) \
{ \
size_t bucket = m_hasher( m_getKey(value) ) % m_tableBuckets; \
Node* curr = m_table[bucket], \
* next = m_table[bucket]; \
while( next ) { curr = next; next = next->m_next(); } \
Node** ptr = curr ? (Node**)&curr->m_nxt : &m_table[bucket]; \
*ptr = new Node( value ); \
/* must be after the node is inserted */ \
++m_items; \
if( SHOULD_GROW( m_tableBuckets, m_items ) ) \
ResizeTable( m_tableBuckets ); \
} \
void CreateNode( const value_type& value ) \
{\
CreateNode(value, m_hasher( m_getKey(value) ) % m_tableBuckets ); \