diff options
| author | Tyge Løvset <[email protected]> | 2023-03-26 22:33:45 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-03-26 22:33:45 +0200 |
| commit | ede39bc98a758674485796174ea860515ec281e6 (patch) | |
| tree | 9cf3cb80a09be277d1581345701d54dda6ecd4f6 /include/stc/algo/filter.h | |
| parent | f2f9eaab3e347d04dfa98978e20fcdcdcb38c72d (diff) | |
| download | STC-modified-ede39bc98a758674485796174ea860515ec281e6.tar.gz STC-modified-ede39bc98a758674485796174ea860515ec281e6.zip | |
Remove more c_with, c_auto
Diffstat (limited to 'include/stc/algo/filter.h')
| -rw-r--r-- | include/stc/algo/filter.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/stc/algo/filter.h b/include/stc/algo/filter.h index 7729799f..111d3273 100644 --- a/include/stc/algo/filter.h +++ b/include/stc/algo/filter.h @@ -24,24 +24,24 @@ #include <stdio.h> #define i_val int #include <stc/cstack.h> -#include <stc/algo/filter.h> +#include <stc/calgo.h> int main() { - c_with (cstack_int stk = c_make(cstack_int, {1, 2, 3, 4, 5, 6, 7, 8, 9}), - cstack_int_drop(&stk)) - { - c_foreach (i, cstack_int, stk) - printf(" %d", *i.ref); - puts(""); - - c_forfilter (i, cstack_int, stk, - c_flt_skipwhile(i, *i.ref < 3) && - (*i.ref & 1) == 0 && // even only - c_flt_take(i, 2)) // break after 2 - printf(" %d", *i.ref); - puts(""); - } + cstack_int stk = c_make(cstack_int, {1, 2, 3, 4, 5, 6, 7, 8, 9}); + + c_foreach (i, cstack_int, stk) + printf(" %d", *i.ref); + puts(""); + + c_forfilter (i, cstack_int, stk, + c_flt_skipwhile(i, *i.ref < 3) && + (*i.ref & 1) == 0 && // even only + c_flt_take(i, 2)) // break after 2 + printf(" %d", *i.ref); + puts(""); + + cstack_int_drop(&stk); } */ #ifndef STC_FILTER_H_INCLUDED |
