All:
- Add wxDir::Close() method (Silverstorm82).
+- Fix compilation of wxHash{Map,Set} with g++ 4.7 (Nathan Ridge).
All (GUI):
// we need to define the class declared by _WX_DECLARE_HASH_SET as a class and
// not a typedef to allow forward declaring it
-#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \
+#define _WX_DECLARE_HASH_SET_IMPL( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \
CLASSEXP CLASSNAME \
: public WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T > \
{ \
{} \
}
+// In some standard library implementations (in particular, the libstdc++ that
+// ships with g++ 4.7), std::unordered_set inherits privately from its hasher
+// and comparator template arguments for purposes of empty base optimization.
+// As a result, in the declaration of a class deriving from std::unordered_set
+// the names of the hasher and comparator classes are interpreted as naming
+// the base class which is inaccessible.
+// The workaround is to prefix the class names with 'struct'; however, don't
+// do this on MSVC because it causes a warning there if the class was
+// declared as a 'class' rather than a 'struct' (and MSVC's std::unordered_set
+// implementation does not suffer from the access problem).
+#ifdef _MSC_VER
+#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME
+#else
+#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) struct STRUCTNAME
+#endif
+
+#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \
+ _WX_DECLARE_HASH_SET_IMPL( \
+ KEY_T, \
+ WX_MAYBE_PREFIX_WITH_STRUCT(HASH_T), \
+ WX_MAYBE_PREFIX_WITH_STRUCT(KEY_EQ_T), \
+ PTROP, \
+ CLASSNAME, \
+ CLASSEXP)
+
#else // no appropriate STL class, use our own implementation
// this is a complex way of defining an easily inlineable identity function...
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*,
@code
WX_DECLARE_HASH_MAP( int,
wxString,
- ::wxIntegerHash,
- ::wxIntegerEqual,
+ wxIntegerHash,
+ wxIntegerEqual,
MyHash );
// using an user-defined class for keys
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
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;
@code
WX_DECLARE_HASH_SET( int,
- ::wxIntegerHash,
- ::wxIntegerEqual,
+ wxIntegerHash,
+ wxIntegerEqual,
MySet );
// using an user-defined class for keys
};
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
namespace
{
-WX_DECLARE_HASH_SET(wxString, ::wxStringHash, ::wxStringEqual,
+WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual,
wxLocaleUntranslatedStrings);
}
// 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);
// 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
{
#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
{