mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-12 04:09:34 +00:00
19 lines
340 B
Nim
19 lines
340 B
Nim
{.experimental: "openSym".}
|
|
|
|
import std/hashes
|
|
|
|
template maxHash(t): untyped = high(t).Hash
|
|
|
|
template implCaptured() {.dirty.} =
|
|
result = maxHash(t)
|
|
|
|
template implInjected() {.dirty.} =
|
|
type Hash = uint8
|
|
result = high(t).Hash
|
|
|
|
proc usesCaptured*[T](t: T): auto =
|
|
implCaptured()
|
|
|
|
proc usesInjected*[T](t: T): auto =
|
|
implInjected()
|