summary refs log tree commit diff stats
path: root/lib/system/indexerrors.nim
blob: 53c52a26a2fef9970316cee6ee3782110ddb9f1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# imported by other modules, unlike helpers.nim which is included

template formatErrorIndexBound*[T](i, a, b: T): string =
  when defined(standalone):
    "indexOutOfBounds"
  else:
    "index " & $i & " not in " & $a & " .. " & $b

template formatErrorIndexBound*[T](i, n: T): string =
  formatErrorIndexBound(i, 0, n)