Depends on what you are casting to what else. E.g. static_cast<std::string>("Hello")
ends up calling std::string
constructor.
Off the top of my head, I can't think of any case where reinterpret_cast
would need to generate actual machine instructions. It's just telling the compiler: take this bit pattern, and believe it to be a value this type.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…