mirror of
https://github.com/codex-storage/constantine.git
synced 2025-02-13 19:26:20 +00:00
Fix booleans initialization
This commit is contained in:
parent
08e12df4ed
commit
007c5e3071
@ -15,11 +15,11 @@ type
|
|||||||
## by conditional branches, we don't use booleans.
|
## by conditional branches, we don't use booleans.
|
||||||
## We use an int to prevent compiler "optimization" and introduction of branches
|
## We use an int to prevent compiler "optimization" and introduction of branches
|
||||||
|
|
||||||
func ctrue*(T: type(Ct)): auto {.inline.}=
|
func ctrue*(T: typedesc[BaseUint]): auto {.inline.}=
|
||||||
(CTBool[T])(true)
|
(CTBool[Ct[T]])(true)
|
||||||
|
|
||||||
func cfalse*(T: type(Ct)): auto {.inline.}=
|
func cfalse*(T: typedesc[BaseUint]): auto {.inline.}=
|
||||||
(CTBool[T])(false)
|
(CTBool[Ct[T]])(false)
|
||||||
|
|
||||||
func ct*[T: BaseUint](x: T): Ct[T] {.inline.}=
|
func ct*[T: BaseUint](x: T): Ct[T] {.inline.}=
|
||||||
(Ct[T])(x)
|
(Ct[T])(x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user