From 9e5a07b1ea4868149a1492e3b36dad11d65863d5 Mon Sep 17 00:00:00 2001 From: jiro4989 Date: Sat, 11 Apr 2020 08:55:11 +0900 Subject: [PATCH] doc: bitops: add notes to documentation comments of macros --- lib/pure/bitops.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/pure/bitops.nim b/lib/pure/bitops.nim index ba4fc28bbb..3d2285cf9e 100644 --- a/lib/pure/bitops.nim +++ b/lib/pure/bitops.nim @@ -130,6 +130,9 @@ when defined(nimHasalignOf): macro setBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 1 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b0000_0011'u8 v.setBits(3, 5, 7) @@ -142,6 +145,9 @@ when defined(nimHasalignOf): macro clearBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 0 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b1111_1111'u8 v.clearBits(1, 3, 5, 7) @@ -154,6 +160,9 @@ when defined(nimHasalignOf): macro flipBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 0 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b0000_1111'u8 v.flipBits(1, 3, 5, 7)