mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-25 00:43:39 +08:00
Declare a class in WX_DECLARE_HASH_MAP() too
Instead of just using a type alias, define a class inheriting from std::unordered_map<> in this macro, as this makes it compatible with the existing code not using wxUSE_STD_CONTAINERS which forward-declares hash map classes. And as this was already done in WX_DECLARE_HASH_SET(), it's also more consistent. Closes #24674.
This commit is contained in:
@@ -25,8 +25,14 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
// Use inheritance instead of simple typedef to allow existing forward
|
||||
// declarations of the hash map classes in the applications using wx to work.
|
||||
#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \
|
||||
typedef std::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME
|
||||
class CLASSNAME : public std::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > \
|
||||
{ \
|
||||
public: \
|
||||
using std::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T >::unordered_map; \
|
||||
}
|
||||
|
||||
#else // wxNEEDS_WX_HASH_MAP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user