Subject: Re: [boost] [integer] Type-safe and bounded integers with compile-time checking
From: Leif Linderstam (leif.ls_at_[hidden])
Date: 2011-09-07 13:26:52


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