mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
refs #876 All metaclass mixins now directly access the metamembers.
This avoids bloating CMetaClassIntrospector with inconvenient convenience methods.
This commit is contained in:
@@ -72,10 +72,12 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
// Work around MSVC2015 bug affecting generic lambda
|
||||
template <typename T>
|
||||
struct Hasher
|
||||
{
|
||||
template <typename T>
|
||||
void operator()(const T &object) { m_hash ^= qHash(object); }
|
||||
template <typename U>
|
||||
void operator()(const U &member) { m_hash ^= qHash(member.in(m_object)); }
|
||||
const T &m_object;
|
||||
uint &m_hash;
|
||||
};
|
||||
|
||||
@@ -496,7 +498,7 @@ namespace BlackMisc
|
||||
{
|
||||
uint hash = baseHash(static_cast<const TBaseOfT<Derived> *>(&value));
|
||||
auto meta = introspect<Derived>().without(MetaFlags<DisabledForHashing>());
|
||||
meta.forEachMember(value, Private::Hasher { hash });
|
||||
meta.forEachMember(Private::Hasher<Derived> { value, hash });
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user