Open victorstewart opened 2 years ago
i solved this by creating my own RTTI type then my own pointer extension, but the fundamental issue remains
struct StaticRTTI {
template<typename TBase>
static size_t get(TBase& obj)
{
return (size_t)static_type_info::getTypeIndex<TBase>();
}
template<typename TBase>
static constexpr size_t get()
{
return (size_t)static_type_info::getTypeIndex<TBase>();
}
template<typename TBase, typename TDerived>
static constexpr TDerived* cast(TBase* obj)
{
static_assert(!std::is_pointer<TDerived>::value, "");
return dynamic_cast<TDerived*>(obj);
}
template<typename TBase>
static constexpr bool isPolymorphic()
{
return std::is_polymorphic<TBase>::value;
}
};
using PointerOwner = bitsery::ext::PointerOwnerBase<bitsery::ext::StaticRTTI>;
Thanks for sharing!
I'll leave this ticket open, so people would know about it.
if you check the backtrace below you'll see that the code crashes on the
__ptr
dereference in non_unique_impl:: hash because it's dereferencing a junk address.apparently __non_unique_impl is a specialization specifically and only for apple arm. crazy that it's broken out of the box.
so we definitely need some kind of workaround for when called on apple platforms.