Range Constrained Types in C++
Posted on Fri 05 September 2014 in misc • View Comments • Tagged with C++, Ada
One of the first things a new Ada programmer will learn is the ability to define constrained type. Which means that one can restrict the values that can be assigned to a variable of this specific type.
subtype Positive is Integer range 1 .. Integer'Last;
Being a subtype …