C++ When should we prefer to use a two chained static_cast over reinterpret_cast

前端 未结 6 1535
不思量自难忘°
不思量自难忘° 2020-12-04 01:29

First of all, this is not a duplicate of Why do we have reinterpret_cast in C++ when two chained static_cast can do it\'s job?.

I know situations where we cannot use

6条回答
  •  情话喂你
    2020-12-04 02:24

    You should not use reinterpret_cast in cases where cross-cast pointers - instead use implicit conversion to void*, then static_cast.

提交回复
热议问题