diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:46 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:46 +0200 |
| commit | 07706f56cd421bf8b101a5c0fe44674d36e161a0 (patch) | |
| tree | bec8b45765788370fbd148d68e05d8b437e60670 /hmap.cpp | |
| parent | 56187184e11b085b82584d3b088c62f427aae83c (diff) | |
tagging ychat-0.5.1ychat-0.5.1
Diffstat (limited to 'hmap.cpp')
| -rw-r--r-- | hmap.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1,6 +1,7 @@ #ifndef hmap_cpp #define hmap_cpp + #include "hmap.h" using namespace std; @@ -160,6 +161,14 @@ int hmap<obj_type, key_type>::nextPrime( int n ) const return n; } template<class obj_type, class key_type> void +hmap<obj_type, key_type>::run_func( void (*func)(obj_type) ) +{ + for( int i = 0; i < array.size( ); i++ ) + if ( array[i].info == ACTIVE ) + ( *func ) ( array[i].element ); +} + +template<class obj_type, class key_type> void hmap<obj_type, key_type>::run_func( void (*func)(obj_type, void*), void* v_arg ) { for( int i = 0; i < array.size( ); i++ ) |
