Compare Enum Values
<p>I want to loop over an array and check, whether the current array index is a value of an enumeration. The array as well as the enumeration are defined as the following:</p>



<pre class="lang-ada prettyprint-override"><code>type Option is (None, A, B, C, D);
type Votes is array(Option) of Natural;

Zero_Option_Distribution: constant Votes := (others =&gt; 0);
Votes_Distribution: Votes := Zero_Option_Distribution;
</code></pre>

<p>The Loop looks like this:</p>

<pre class="lang-ada prettyprint-override"><code>for I in Voting_System.Votes_Distribution'Range loop
   -- this is where I would like to check whether I is a representation of either of the enum values
end loop;
</code></pre>

<p>I already tried everything that came to my mind, like</p>

<pre class="lang-ada prettyprint-override"><code>if I = Voting_System.Option(None) then -- ...
</code></pre>

<p>and</p>

<pre class="lang-ada prettyprint-override"><code>if I'Val("None") then -- ...
</code></pre>

<p>and some more versions where each of them didn't work.</p>

<p>I really don't have any more ideas to achieve this.</p>