From 79b256e3a43e8c2ebcdb191792817ae59c880ec4 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 5 Oct 2025 19:54:19 +1100 Subject: [PATCH] add CondIncr --- util.d | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/util.d b/util.d index 0a15129..f358db0 100644 --- a/util.d +++ b/util.d @@ -23,6 +23,17 @@ Int3() } } +pragma(inline) bool +CondIncr(T, i64 step)(bool cond, T* val) +{ + if(cond) + { + *val += step; + } + + return cond; +} + T[] CastStr(T)(string str) {