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 of 5aae7c7387,
d2c1fce24e and
ec510a0c4b from master)
This commit is contained in:
Jan van Dijk
2015-06-02 02:07:39 +02:00
committed by Václav Slavík
parent 4b9712582c
commit 349c905ffc

View File

@@ -164,13 +164,17 @@ private:
public: \
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 \
{ \
return IsSameClass(otherType); \
} \
private: \
static bool AreSameClasses(const wxAnyValueType& a, const wxAnyValueType& b) \
{ \
return wxTypeId(a) == wxTypeId(b); \
} \
static wxAnyValueTypeScopedPtr sm_instance; \
public: \
static wxAnyValueType* GetInstance() \