#ifndef RFL_INTERNAL_PTRCAST_HPP_ #define RFL_INTERNAL_PTRCAST_HPP_ namespace rfl::internal { /// Normally, we would use std::launder(reinterpret_cast<...>(...)), /// but there are weird issues on GCC 12 under certain compiler settings, /// so we are using this workaround instead. template inline T1 ptr_cast(T2* _ptr) { return static_cast(static_cast(_ptr)); } template inline T1 ptr_cast(const T2* _ptr) { return static_cast(static_cast(_ptr)); } } // namespace rfl::internal #endif