How can the allowed range of an integer be restricted with compile time errors?
<p>I would like to create a type that is an integer value, but with a restricted range.
Attempting to create an instance of this type with a value outside the allowable range should cause a compile time error.</p>

<p>I have found examples that allow compile time errors to be triggered when an <a href="http://www.bearcave.com/software/java/misl/enum/type_safe_enum.html" rel="nofollow">enumeration value outside those specified is used</a>, but none that allow a restricted range of integers (without names).</p>

<p>Is this possible?</p>
