MkCastTo: Use '_v' variants of type traits where applicable

Same thing, but less typing, slightly shrinking the file size.
This commit is contained in:
Lioncash 2019-09-30 22:15:50 -04:00
parent 81a019b1e0
commit bf65456a2c
1 changed files with 2 additions and 2 deletions

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 = reinterpret_cast<T*>(std::is_convertible_v<%s*, T*> ? p : nullptr);
}
''' % (qual, qual))