"Taylor, Bill - UK" wrote:
>
> John
>
> You could always look at the value of Control_Data.Month'Valid to check that
> Unchecked_Conversion has yielded a valid value. The attribute was added in
> Ada95 precisely becuase you couldn't rely on compilers to perform a range
> check. If they did, then the Unchecked_Conversion wouldn't be "unchecked".
>
Applying the 'Valid attribute on each record component could be really
tedious : a 'Valid on a record is the solution to get an easy
"Checked_Conversion" generic.
Last time i went on this argument, i had no answer. Provided that 'Valid
apply to each component, it's easy to implement for compilers, or am i
wrong?
The compiler could also easily optimized the check on component that
can't be invalid.

Lionel Draghi.