2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 05:44:56 +00:00

Merge pull request #95 from lioncash/gen

MkCastTo: Use '_v' variants of type traits where applicable
This commit is contained in:
2019-10-01 06:43:33 -07:00
committed by GitHub

View File

@@ -183,8 +183,8 @@ for tp in CENTITY_TYPES:
qual = getqualified(tp)
sourcef.write('''template <class T>
void TCastToPtr<T>::Visit(%s* p) {
static_assert(sizeof(T) > 0 && !std::is_void<T>::value, "TCastToPtr can not cast to incomplete type");
ptr = reinterpret_cast<T*>(std::is_convertible<%s*, T*>::value ? p : nullptr);
static_assert(sizeof(T) > 0 && !std::is_void_v<T>, "TCastToPtr can not cast to incomplete type");
ptr = static_cast<T*>(std::is_convertible_v<%s*, T*> ? p : nullptr);
}
''' % (qual, qual))