mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #95 from lioncash/gen
MkCastTo: Use '_v' variants of type traits where applicable
This commit is contained in:
commit
4d94923a23
|
@ -183,8 +183,8 @@ for tp in CENTITY_TYPES:
|
||||||
qual = getqualified(tp)
|
qual = getqualified(tp)
|
||||||
sourcef.write('''template <class T>
|
sourcef.write('''template <class T>
|
||||||
void TCastToPtr<T>::Visit(%s* p) {
|
void TCastToPtr<T>::Visit(%s* p) {
|
||||||
static_assert(sizeof(T) > 0 && !std::is_void<T>::value, "TCastToPtr can not cast to incomplete type");
|
static_assert(sizeof(T) > 0 && !std::is_void_v<T>, "TCastToPtr can not cast to incomplete type");
|
||||||
ptr = reinterpret_cast<T*>(std::is_convertible<%s*, T*>::value ? p : nullptr);
|
ptr = static_cast<T*>(std::is_convertible_v<%s*, T*> ? p : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
''' % (qual, qual))
|
''' % (qual, qual))
|
||||||
|
|
Loading…
Reference in New Issue