title: Type conversion in C++: related and unrelated types
body: <p>I was reading "The C++ Programming Language" by Bjarne Stroustrup to learn C++ and encountered with the following passage:</p>
  
  <blockquote>
    <p>The <code>static_cast</code> operator converts between <em>related types</em> such as one pointer type to another in the same class hierarchy, an integral type to an enumeration, or a floating-point type to an integral type. The <code>reinterpret_case</code> handles conversions between <em>unrelated types</em> such as an integer to a pointer or a pointer to an unrelated pointer type.</p>
  </blockquote>
  
  <p>To me, it is not clear what determines any two given types be related or unrelated and the examples mentioned seem not that exhaustive.</p>
  
  <p>Stroustrup says that types are classified into 1. Arithmetic types 2. User-defined types and 3. Built-in types, and from the examples above, he regards arithmetic type (int) to be related to a user-defined type (enum). A float type to an int is obvious because they both are arithmetic types.</p>
  
  <p>However, he classifies two pointers, which should be both built-in types according to his definition, to be unrelated.</p>
  
  <p>So what do we exactly mean by saying "two types are related (unrelated)"?</p>