Fix wxHash{Set,Map} compilation with g++ 4.7 in C++11 mode.

Fully qualify the hasher and comparator classes used with
WX_DECLARE_HASH_{SET,MAP} macros as they're used as base classes by the
standard library implementation in g++ 4.7 and using them without the scope
operator results in compilation errors because they're interpreted as being
(inaccessible) base classes and not the global ones.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-02-10 10:22:45 +00:00
parent 37fff49cf1
commit 8d9eee8320
7 changed files with 16 additions and 16 deletions

View File

@ -29,7 +29,7 @@ class wxHtmlTextPieces;
class wxHtmlParserState;
WX_DECLARE_HASH_SET_WITH_DECL_PTR(wxHtmlTagHandler*,
wxPointerHash, wxPointerEqual,
::wxPointerHash, ::wxPointerEqual,
wxHtmlTagHandlersSet,
class WXDLLIMPEXP_HTML);
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxHtmlTagHandler*,

View File

@ -83,8 +83,8 @@
@code
WX_DECLARE_HASH_MAP( int,
wxString,
wxIntegerHash,
wxIntegerEqual,
::wxIntegerHash,
::wxIntegerEqual,
MyHash );
// using an user-defined class for keys
@ -119,8 +119,8 @@
WX_DECLARE_HASH_MAP( MyKey, // type of the keys
SOME_TYPE, // any type you like
MyKeyHash, // hasher
MyKeyEqual, // key equality predicate
::MyKeyHash, // hasher
::MyKeyEqual, // key equality predicate
CLASSNAME); // name of the class
@endcode

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

View File

@ -1440,7 +1440,7 @@ wxString wxTranslations::ChooseLanguageForDomain(const wxString& WXUNUSED(domain
namespace
{
WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual,
WX_DECLARE_HASH_SET(wxString, ::wxStringHash, ::wxStringEqual,
wxLocaleUntranslatedStrings);
}

View File

@ -72,7 +72,7 @@ const char wxGridNameStr[] = "grid";
// Required for wxIs... functions
#include <ctype.h>
WX_DECLARE_HASH_SET_WITH_DECL_PTR(int, wxIntegerHash, wxIntegerEqual,
WX_DECLARE_HASH_SET_WITH_DECL_PTR(int, ::wxIntegerHash, ::wxIntegerEqual,
wxGridFixedIndicesSet, class WXDLLIMPEXP_ADV);

View File

@ -107,7 +107,7 @@ class wxXmlResourceDataRecords : public wxVector<wxXmlResourceDataRecord*>
// this is a class so that it can be forward-declared
};
WX_DECLARE_HASH_SET_PTR(int, wxIntegerHash, wxIntegerEqual, wxHashSetInt);
WX_DECLARE_HASH_SET_PTR(int, ::wxIntegerHash, ::wxIntegerEqual, wxHashSetInt);
class wxIdRange // Holds data for a particular rangename
{

View File

@ -32,7 +32,7 @@
#include "wx/mimetype.h"
#include "wx/vector.h"
WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual, StringSet);
WX_DECLARE_HASH_SET(wxString, ::wxStringHash, ::wxStringEqual, StringSet);
class XRCWidgetData
{