From e68480f2fc508ce73cad331ce4e8439e07d25702 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 1 Sep 2025 22:00:02 +0300 Subject: use <> as expansion characters + I kind of like the 'symmetry' of <> being 'self' and being some parameter, but having to type lots of extra <*> is a bit annoying, and might also be an issue for C++. Still, enough functionality for a hashmap example --- example_hashmap/new/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'example_hashmap/new/main.c') diff --git a/example_hashmap/new/main.c b/example_hashmap/new/main.c index 4846ab5..db575c6 100644 --- a/example_hashmap/new/main.c +++ b/example_hashmap/new/main.c @@ -1,6 +1,9 @@ #include #include +/* provide generic any that matches anything/everything */ +typedef any {} + #include "map.h" #define foreach(name, i, s) \ @@ -9,7 +12,7 @@ /* int wrapper, provides cmp/hash for a generic integer type * (here a trait like is_integer would be ideal but oh well) */ typedef intw[any I]() { - typedef I <>; + typedef <>; size_t <>_hash(<> *a) { -- cgit v1.2.3