tags 319972 patch
thanks

Hello,

In FindHash.hpp, there are two definitions of the findHash function, one
with const keys, and one without the const modifier.

The situation is similar to:
f(T) {...}
f(const T) {...}

When f(const string) is used, g++-4 doesn't know if it should take the
first definition with T=(const string), or the second, with T=string.



Since the two implementations of findHash are identical, I removed the one
with the const modifier.
This removal should not loose any verification ('find' always operates on a
const object anyway).

Note: I've let the definition of the second findHash when
"(__INTEL_COMPILER >= 700)", since I can't test this.

It compiles with gcc 2.95, 3.2, 3.3 and 4.0.2.

hth,
-- 
Nekral
--- criticalmass-0.9.11/utils/FindHash.hpp      2004-12-19 07:14:37.000000000 
+0100
+++ ../criticalmass-0.9.11/utils/FindHash.hpp   2005-08-07 11:21:44.000000000 
+0200
@@ -30,14 +30,11 @@
     return ci->second;
 }
 
+#if (__INTEL_COMPILER >= 700)
 template< class _KeyT, class _ValT >
 _ValT* findHash( 
     const _KeyT &trigger, 
-#if (__INTEL_COMPILER >= 700)
     hash_map< _KeyT, _ValT*, hash<_KeyT>, equal_to<_KeyT> > & hashMap )
-#else
-    hash_map< const _KeyT, _ValT*, hash<const _KeyT>, equal_to<const _KeyT> > 
& hashMap )
-#endif
 {
     typename hash_map< const _KeyT, _ValT*, hash<const _KeyT> 
>::const_iterator ci;
     ci = hashMap.find( trigger);
@@ -48,5 +45,6 @@
 
     return ci->second;
 }
+#endif
 
 #endif

Reply via email to