Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58745 - trunk/libs/functional/hash/test
From: daniel_james_at_[hidden]
Date: 2010-01-06 03:43:48


Author: danieljames
Date: 2010-01-06 03:43:47 EST (Wed, 06 Jan 2010)
New Revision: 58745
URL: http://svn.boost.org/trac/boost/changeset/58745

Log:
Explicitly cast values to avoid warning on Visual C++ 10
Text files modified:
   trunk/libs/functional/hash/test/hash_map_test.hpp | 18 ++++++++++--------
   1 files changed, 10 insertions(+), 8 deletions(-)

Modified: trunk/libs/functional/hash/test/hash_map_test.hpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_map_test.hpp (original)
+++ trunk/libs/functional/hash/test/hash_map_test.hpp 2010-01-06 03:43:47 EST (Wed, 06 Jan 2010)
@@ -22,19 +22,21 @@
     {
         const int number_of_containers = 10;
         T containers[number_of_containers];
- typedef typename T::value_type pair;
+ typedef BOOST_DEDUCED_TYPENAME T::value_type pair;
+ typedef BOOST_DEDUCED_TYPENAME T::key_type key;
+ typedef BOOST_DEDUCED_TYPENAME T::mapped_type value;
 
         for(int i = 0; i < 5; ++i) {
             for(int j = 0; j < i; ++j)
- containers[i].insert(pair(0, 0));
+ containers[i].insert(pair(key(0), value(0)));
         }
 
- containers[6].insert(pair(1,0));
- containers[7].insert(pair(1,0));
- containers[7].insert(pair(1,0));
- containers[8].insert(pair(-1,1));
- containers[9].insert(pair(-1,3));
- containers[9].insert(pair(-1,3));
+ containers[6].insert(pair(key(1),value(0)));
+ containers[7].insert(pair(key(1),value(0)));
+ containers[7].insert(pair(key(1),value(0)));
+ containers[8].insert(pair(key(-1),value(1)));
+ containers[9].insert(pair(key(-1),value(3)));
+ containers[9].insert(pair(key(-1),value(3)));
 
         HASH_NAMESPACE::hash<T> hasher;
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk