From d196350d2245e44658a9acc87517e317eba70322 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 2 Aug 2019 11:51:04 +0300 Subject: [PATCH] Add anonConst --- stew/objects.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stew/objects.nim b/stew/objects.nim index 39b3874..3307f6d 100644 --- a/stew/objects.nim +++ b/stew/objects.nim @@ -21,3 +21,6 @@ proc toArray*[T](N: static int, data: openarray[T]): array[N, T] = doAssert data.len == N copyMem(addr result[0], unsafeAddr data[0], N) +template anonConst*(val: untyped): untyped = + const c = val + c