title: Is there a limit of n bits when bit shifting?
body: <p>While trying to come up with a scheme for a bitboard class, I decided use global compile time variables to represent key bit board configurations, ex. the initial position of all black rooks.</p>
  
  <pre><code>constexpr uint64_t BLACK_ROOK_INIT  = 0x1 | (0x1 &lt;&lt; 56);
  </code></pre>
  
  <p>However I am getting compiler errors.  The compiler appears to be treating this value as a 32 bit value and type casting or adding additional 0's does not seem to make a difference.  The type definition is from .</p>
  
  <p>As soon as I drop constexp from this expression it compiles, however still produces the equivalent warning. Why is this happening? I thought it might be a limitation of the pre-processor, but the problem persists without constexp.</p>
  
  <pre><code>chess.cpp:16:64: error: right operand of shift expression ‘(1 &lt;&lt; 56)’ is &gt;= than the precision of the left operand [-fpermissive]
  </code></pre>
  
  <p>FYI, this also does not compile</p>
  
  <pre><code>constexpr int64_t BLACK_ROOK_INIT = (int64_t)0x1 | (int64_t)(0x1 &lt;&lt; 32);
  </code></pre>