title: Define "custom" integer-based type?
body: <p>I have a program that is interfacing with an external library that, among other things, has an unsigned 12-bit value packed in a larger struct.</p>
  
  <p>This used to be 8 bits, so we simply marshaled it as a byte.</p>
  
  <p>Now that it's 12 bits... I can use a ushort, but that opens up issues of (a) range checking and (b) marshaling.</p>
  
  <p>Is there a simple way of implementing a constrained numeric type like this, where I don't have to override every assignment and comparison method?</p>