avoid using reinterpret_cast (it breaks type-punning rules)