Work around clang warning about side effects inside typeid().
This warning was harmless but very annoying as it was given for each and every inclusion of this header. Closes #16968. (this is a backport of5aae7c7387
,d2c1fce24e
andec510a0c4b
from master)
This commit is contained in:
committed by
Václav Slavík
parent
4b9712582c
commit
349c905ffc
@@ -164,13 +164,17 @@ private:
|
|||||||
public: \
|
public: \
|
||||||
static bool IsSameClass(const wxAnyValueType* otherType) \
|
static bool IsSameClass(const wxAnyValueType* otherType) \
|
||||||
{ \
|
{ \
|
||||||
return wxTypeId(*sm_instance.get()) == wxTypeId(*otherType); \
|
return AreSameClasses(*sm_instance.get(), *otherType); \
|
||||||
} \
|
} \
|
||||||
virtual bool IsSameType(const wxAnyValueType* otherType) const \
|
virtual bool IsSameType(const wxAnyValueType* otherType) const \
|
||||||
{ \
|
{ \
|
||||||
return IsSameClass(otherType); \
|
return IsSameClass(otherType); \
|
||||||
} \
|
} \
|
||||||
private: \
|
private: \
|
||||||
|
static bool AreSameClasses(const wxAnyValueType& a, const wxAnyValueType& b) \
|
||||||
|
{ \
|
||||||
|
return wxTypeId(a) == wxTypeId(b); \
|
||||||
|
} \
|
||||||
static wxAnyValueTypeScopedPtr sm_instance; \
|
static wxAnyValueTypeScopedPtr sm_instance; \
|
||||||
public: \
|
public: \
|
||||||
static wxAnyValueType* GetInstance() \
|
static wxAnyValueType* GetInstance() \
|
||||||
|
Reference in New Issue
Block a user