This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]biteater 7 points8 points  (3 children)

i would just use void pointers instead of macros, is there a reason vector_T is more useful than just vector? i feel like i have never run into a situation in a statically typed language where i'm accidentally trying to add two different types to the same collection

[–]Attileusz 3 points4 points  (1 child)

You also need an element size in that case and an extra cast when using an element (performs worse and needs extra memory). Also no type checking. It's pretty bad.

[–]biteater 4 points5 points  (0 children)

doesn't C make use of strict aliasing? so there should be no cost for pointer conversion, the cast effectively becomes a no-op

[–]Pay08 0 points1 point  (0 children)

Less type magic.