Hello my friends, I have a question.
I started to write a library for data structures like hash maps, vectors and stacks. To make sure all kind of values can be passed every data argument is just a void*. That's fine if I want to store pointers, but not if I want to store numbers or actual structs, not only pointers to them. So I thought just use macros but the problem is, that I would have to write two versions for each macro, because I cannot pass e.g "&vector" but have to pass "vector" because the adress-of operator won't get evaluated in a macro but instead it is used as its name. And I don't want to create a temporary variable everytime I want to use these macros just for this. Then there is this other approach where you never pass the actual data into the function and it returns an index in the array that you then change. This -> Generic Vector Type in C * GitHub is an example for this. The problem is first, you have to cast the array everytime you want to index it because the type is void and second this only works for data structures where the data is laid out in a plain array. What do you do if you want for example a vector that could store not only pointers but also structs or numbers?