A better fix for wxHash{Map,Set} with g++ 4.7.

This reverts r70556, i.e. removes the scope operators added by it to all
WX_DECLARE_HASH_{MAP,SET} macros, and implements a workaround for the problem
due to the use of empty base class optimization in g++ 4.7 standard library
implementations inside the macros themselves by prepending the hasher and
comparator classes with explicit "struct".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-08-06 11:06:45 +00:00
parent 03a1d86352
commit 7a7fa93b0d
9 changed files with 43 additions and 17 deletions

View File

@@ -20,11 +20,11 @@
class MyClass { ... };
// same, with MyClass* keys (only uses pointer equality!)
WX_DECLARE_HASH_SET( MyClass*, ::wxPointerHash, ::wxPointerEqual, MySet1 );
WX_DECLARE_HASH_SET( MyClass*, wxPointerHash, wxPointerEqual, MySet1 );
// same, with int keys
WX_DECLARE_HASH_SET( int, ::wxIntegerHash, ::wxIntegerEqual, MySet2 );
WX_DECLARE_HASH_SET( int, wxIntegerHash, wxIntegerEqual, MySet2 );
// declare a hash set with string keys
WX_DECLARE_HASH_SET( wxString, ::wxStringHash, ::wxStringEqual, MySet3 );
WX_DECLARE_HASH_SET( wxString, wxStringHash, wxStringEqual, MySet3 );
MySet1 h1;
MySet2 h1;
@@ -70,8 +70,8 @@
@code
WX_DECLARE_HASH_SET( int,
::wxIntegerHash,
::wxIntegerEqual,
wxIntegerHash,
wxIntegerEqual,
MySet );
// using an user-defined class for keys
@@ -105,8 +105,8 @@
};
WX_DECLARE_HASH_SET( MyKey, // type of the keys
::MyKeyHash, // hasher
::MyKeyEqual, // key equality predicate
MyKeyHash, // hasher
MyKeyEqual, // key equality predicate
CLASSNAME); // name of the class
@endcode