I
Ido Yehieli
Hi,
can I define types with a limitation on the data the type contain,
rather than just the size it will have in memory?
For example: a bound_int which can only be in a certain range, so
don't i don't have to have a bound checking function like this one:
int in_range(int i, int min, int max){
----if(i<min)
--------return min;
----if(i>max)
--------return max;
}
Or a prime_number type, and so on.
Thanks,
Ido.
can I define types with a limitation on the data the type contain,
rather than just the size it will have in memory?
For example: a bound_int which can only be in a certain range, so
don't i don't have to have a bound checking function like this one:
int in_range(int i, int min, int max){
----if(i<min)
--------return min;
----if(i>max)
--------return max;
}
Or a prime_number type, and so on.
Thanks,
Ido.