mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 21:17:48 +00:00
@@ -783,7 +783,7 @@ proc contains*[T](s: TSlice[T], value: T): bool {.noSideEffect, inline.} =
|
||||
result = s.a <= value and value <= s.b
|
||||
|
||||
template `in` * (x, y: expr): expr {.immediate.} = contains(y, x)
|
||||
## Suger for contains
|
||||
## Sugar for contains
|
||||
##
|
||||
## .. code-block:: Nimrod
|
||||
## assert(1 in (1..3) == true)
|
||||
|
||||
Reference in New Issue
Block a user