3 ms·
The two other responses already described what intrusive containers are. Have a look at https://troydhanson.github.io/uthash/ https://troydhanson.github.io/utha
by dividuum 11y ago
The two other responses already described what intrusive containers are. Have a look at https://troydhanson.github.io/uthash/ https://troydhanson.github.io/uthash/ to see an implementation of them that I personally like and use in my C projects. It's really simple to have a struct that is indexed by multiple keys by basically just adding two UT_hash_handle values to your struct and then using the uthash functions. On top of that, it's a really nice implementation that is completely self-contained in a single C header file.