Hacker News new | past | comments | ask | show | jobs | submit login

Hrm. Check out sys/queue.h in any BSD (Linux too - though Linux kernel code IIRC uses a different list implementation). You don't necessarily need void * for a generic list, and you most certainly don't have to reinvent the wheel.



queue.h is an improvement. You still need to somehow know this is in BSD and you'll need to copy it to build on different systems.

The thing is that in C, most people do reinvent the wheel, including the person in the original article and as you say, the Linux kernel. That's been my experience.

std::list is standard and cleaner IMO.




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

Search: