我不明白为什么实际上需要bit_cast而不是使用reinterpret_cast来实现char*。我所理解的是,使用这个演员,我们并没有违反严格的混叠规则。但在这一点上,我有点困惑,因为如果访问是UB,因为内存未对齐,什么时候可以使用reinterpret_cast操作字节?根据标准,强制转换应该允许访问(读/写)内存。has_unique_object_representations_v<T>,
"T may not have padding bits");
我读了一些专门来自的关于静态和动态类型转换用法的文章template<class Base, class Derived>
inline Handle<Base> STATIC_CAST(Handle<Derived> hdDerived* dp = hd.get(); // Assume this gives pointer of derived class obj