This commit is contained in:
Timothee Cour
2021-04-19 19:02:52 -07:00
committed by GitHub
parent 3b80f0dc8e
commit ad67bcf379
5 changed files with 9 additions and 16 deletions

View File

@@ -510,14 +510,6 @@ proc `..`*[T, U](a: sink T, b: sink U): HSlice[T, U] {.noSideEffect, inline, mag
## echo a[2 .. 3] # @[30, 40]
result = HSlice[T, U](a: a, b: b)
proc `..`*[T](b: sink T): HSlice[int, T] {.noSideEffect, inline, magic: "DotDot".} =
## Unary `slice`:idx: operator that constructs an interval `[default(int), b]`.
##
## .. code-block:: Nim
## let a = [10, 20, 30, 40, 50]
## echo a[.. 2] # @[10, 20, 30]
result = HSlice[int, T](a: 0, b: b)
when defined(hotCodeReloading):
{.pragma: hcrInline, inline.}
else: