title: How to avoid integral promotion for bitwise operations
body: <p>I'm floored that VisualStudio 2015 insists on promoting a <code>WORD</code> (<code>unsigned short</code>) to an <code>unsigned int</code> when only <code>WORD</code> values are involved in only bit manipulations. (i.e. promotes 16 bit to 32 bit when doing 16bit | 16bit).</p>
  
  <p>e.g.</p>
  
  <pre><code>// where WORD is a 'unsigned short'
  const WORD kFlag = 1;
  WORD old = 2;
  auto value = old | kFlag;  // why the blazes is value an unsigned int (32 bits)
  </code></pre>
  
  <p>Moreover, is there a way to get 0x86 intrinsics for <code>WORD|WORD</code>?  I surely do not want to pay for (16->32|16->)->16.  Nor does this code need to consume more than a couple of 16 bit registers, not a few 32 bit regs.</p>
  
  <p>But the registry use is really just an aside.  The optimizer is welcome to do as it pleases, so long as the results are indistinguishable for me.  (i.e. it should not change the size in a visible way).</p>
  
  <p>The main problem for me is that using flags|kFlagValue results in a wider entity, and then pumping that into a template gives me a type mismatch error (template is rather much longer than I want to get into here, but the point is it takes two arguments, and they should match in type, or be trivially convertible, but aren't, due to this automatic size-promotion rule).</p>
  
  <p>If I had access to a "conservative bit processing function set" then I could use:</p>
  
  <pre><code>      flag non-promoting-bit-operator kFlagValue
  </code></pre>
  
  <p>To achieve my ends.</p>
  
  <p>I guess I have to go write that, or use casts all over the place, because of this unfortunate rule.</p>
  
  <p>C++ should not promote in this instance.  It was a poor language choice.</p>