Rewrite M_REDUCE to be much faster.

Rewrite M_SEQ to be much faster.
Change interface of M_SEQ as we can easily apply M_MAP / M_MAP2 to further apply macro.
This commit is contained in:
Patrick Pelissier committed 2017-09-20 23:40:22 +02:00
1 parent 793f834a56
commit c79626225b
2 files changed
+428 -21

No files matched your search

+2 -2
View File
@@ -268,8 +268,8 @@ static void test_reduce(void)
{
#define id(x,a) a
#define add(a,b) a + b
assert ( M_REDUCE2(id, add, d, M_SEQ(1, 5, M_ID)) == 5 * 6 /2);
assert ( M_REDUCE2(id, add, d, M_SEQ(1, 10, M_ID)) == 10 * 11 /2);
assert ( M_REDUCE2(id, add, d, M_SEQ(1, 5)) == 5 * 6 /2);
assert ( M_REDUCE2(id, add, d, M_SEQ(1, 10)) == 10 * 11 /2);
}
int main(void)