Declaring new numeric types
<p>Back in university when i used pascal, i learnt that you could declare a type which was a range of numbers. It was something like:</p>

<pre><code>&lt;somekeyword&gt; TypeName 1..10; or something like that.
</code></pre>

<p>Long story short, i was wondering if and how you can create a type that has a range of a possible number values.</p>

<p>Thanks in advance.</p>

<p>EDIT:
Sorry if i wasnt clear, i am looking for something in c++ in which i can declare a numeric type (eg byte (0..255) or DayOfYear (1..31)).</p>
