allow custom index range
optimized (in that case constructor can be inlined)