Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The limitation with void pointers is that it can only inline values <= the size of a pointer. If you have something larger then you need to allocate it separately which may have cache efficiency issues.

The main alternative, other than hardcoding an element type, is to use macros and pass the element type in the definition.

Sometimes you just don't have the option of a C++ compiler. Also, and this was a situation I was in recently, I needed a collection in a small area of my C code so it really didn't warrant a toolset change.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: