From d7ad5a0289b22d16a67b9fc2efe1a721e4a5a1ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Jul 2008 18:20:06 +0000 Subject: [PATCH] define {first,second}_type in the struct declared by _WX_DECLARE_PAIR too for compatibility with std::pair, we can avoid #ifdefs in the code using the hash then (#9725) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/hashmap.h | 2 ++ tests/hashes/hashes.cpp | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index c6f6b0c..1c11d75 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -425,6 +425,8 @@ protected: \ CLASSEXP CLASSNAME \ { \ public: \ + typedef KEY_T first_type; \ + typedef VALUE_T second_type; \ typedef KEY_T t1; \ typedef VALUE_T t2; \ typedef const KEY_T const_t1; \ diff --git a/tests/hashes/hashes.cpp b/tests/hashes/hashes.cpp index e2a0f6b..bd62198 100644 --- a/tests/hashes/hashes.cpp +++ b/tests/hashes/hashes.cpp @@ -356,7 +356,7 @@ IntT MakeKey(size_t i, size_t count) IntT max = 1; max <<= sizeof(KeyT) * 8 - 2; max -= count / 4 + 1; - + return max / count * 4 * i + i / 3; } @@ -380,11 +380,7 @@ void MakeKeyValuePair(size_t i, size_t count, T*& key, ValueT& value) template void HashMapTest() { -#if wxUSE_STL && defined HAVE_STL_HASH_MAP typedef typename HashMapT::value_type::second_type value_type; -#else - typedef typename HashMapT::value_type::t2 value_type; -#endif typedef typename HashMapT::key_type key_type; typedef typename HashMapT::iterator Itor; -- 2.7.4