
7 Sep
2011
7 Sep
'11
5:26 p.m.
Christopher Jefferson skrev 2011-09-06 20:38:
Could you give an example of a non-trivial algorithm, where this would help? I am having difficulty imaging something where bounds can be usefully detected at compile time.
No, the uses I saw all involved just trivial computations like multiplying a time in seconds with number of ticks / second. I also cannot see a case where the result of a non-trivial algorithm can have its bounds decided statically, certainly not any iterative algorithm. I was thinking that a range conversion operation with run-time checking would fill this gap, but the approach that Ben Robinson has taken with his MetaBoundedInt seems much more fruitful and reasonable. Sincerely, Leif Linderstam