aboutsummaryrefslogtreecommitdiff
path: root/stdlib/integers.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-02-13 15:21:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-02-13 15:21:00 -0500
commitc4479e4bd61fb2c68fdac2637a20d6d99f7b9552 (patch)
treed6cc4335d64ad9d8be9e375f6e820cfcccd153df /stdlib/integers.h
parent5be955904682300153af0abdfd6b711b9da2ac8f (diff)
Add Int:onward() iterator
Diffstat (limited to 'stdlib/integers.h')
-rw-r--r--stdlib/integers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/stdlib/integers.h b/stdlib/integers.h
index fce243a9..7bed4551 100644
--- a/stdlib/integers.h
+++ b/stdlib/integers.h
@@ -35,6 +35,7 @@
Text_t type_name ## $octal(c_type i, Int_t digits, bool prefix); \
Array_t type_name ## $bits(c_type x); \
Closure_t type_name ## $to(c_type first, c_type last, Optional ## type_name ## _t step); \
+ Closure_t type_name ## $onward(c_type first, c_type step); \
PUREFUNC Optional ## type_name ## _t type_name ## $parse(Text_t text); \
MACROLIKE PUREFUNC c_type type_name ## $clamped(c_type x, c_type min, c_type max) { \
return x < min ? min : (x > max ? max : x); \
@@ -102,6 +103,7 @@ Text_t Int$format(Int_t i, Int_t digits);
Text_t Int$hex(Int_t i, Int_t digits, bool uppercase, bool prefix);
Text_t Int$octal(Int_t i, Int_t digits, bool prefix);
PUREFUNC Closure_t Int$to(Int_t first, Int_t last, OptionalInt_t step);
+PUREFUNC Closure_t Int$onward(Int_t first, Int_t step);
OptionalInt_t Int$from_str(const char *str);
OptionalInt_t Int$parse(Text_t text);
Int_t Int$abs(Int_t x);