summaryrefslogtreecommitdiffhomepage
path: root/include/stc/algo/crange.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-12 13:30:15 +0100
committerTyge Løvset <[email protected]>2023-03-12 13:30:15 +0100
commitc9be5f66a481bd040b36a25314f6589dd939daa5 (patch)
treed71cc01f17fabc526a72219c225b015b4130c8b3 /include/stc/algo/crange.h
parent1ac8bb4ff664baa838b44ed6bf62225766f000c5 (diff)
downloadSTC-modified-c9be5f66a481bd040b36a25314f6589dd939daa5.tar.gz
STC-modified-c9be5f66a481bd040b36a25314f6589dd939daa5.zip
Safer state machine in coroutine.h (internal).
Removed c_forwhile() macro. Redundant, use c_forfilter(). Removed find and eq in cspan (use general c_find_if() instead for search).
Diffstat (limited to 'include/stc/algo/crange.h')
-rw-r--r--include/stc/algo/crange.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/algo/crange.h b/include/stc/algo/crange.h
index 4fc957b6..ca06c258 100644
--- a/include/stc/algo/crange.h
+++ b/include/stc/algo/crange.h
@@ -34,9 +34,9 @@ int main()
// use a temporary crange object.
int a = 100, b = INT32_MAX;
- c_forfilter (i, crange, crange_obj(a, b, 8)
- , i.index > 10
- && c_flt_take(i, 3))
+ c_forfilter (i, crange, crange_obj(a, b, 8),
+ c_flt_skip(i, 10) &&
+ c_flt_take(i, 3))
printf(" %lld", *i.ref);
puts("");
}