Janice Caron wrote: > The problem is to do it without the explicit cast. The problem is how > to let the compiler prove that it's safe. And that's why, if you don't > want an explicit cast in there, I believe that returning indeces is > the best way to go. I see, you propose a "Range Type". And indeed, this looks like a nice solution for this problem.