Revert static_cast in MkCastTo.py

This commit is contained in:
Phillip Stephens 2019-10-01 07:27:20 -07:00
parent df9b8bc05d
commit b38ba6b636
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ for tp in CENTITY_TYPES:
sourcef.write('''template <class T>
void TCastToPtr<T>::Visit(%s* p) {
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);
ptr = reinterpret_cast<T*>(std::is_convertible_v<%s*, T*> ? p : nullptr);
}
''' % (qual, qual))