C++标准转换运算符 :reinterpret_cast <new_type> (expression)

 

new_type a = reinterpret_cast <new_type> (value)

将value的值转成new_type类型的值,a和value的值一模一样。比特位不变

reinterpret_cast用在任意指针(或引用)类型之间的转换;以及指针与足够大的整数类型之间的转换;从整数类型(包括枚举类型)到指针类型,无视大小。

 

介绍:http://www.cnblogs.com/ider/archive/2011/07/30/cpp_cast_operator_part3.html

文档:

  1. C++ Language Tutorial - Type Casting
  2. Object Oriented Design
  3. IBM Complilers - XL C/C++ V9.0 for Linux - The reinterpret_cast operator (C++ only)
  4. Bjarne Stroustrup's C++ Style and Technique FAQ
  5. MSDN Visual C++ Developer Center - reinterpret_cast Operator
posted @ 2015-12-22 10:25  shinymood  阅读(175)  评论(0)    收藏  举报