HPDCS/ROOT-Sim

List.h should support multiple lists

Closed this issue · 1 comments

Currently list.h requires the next and prev pointers to be explicitly declared in list nodes. While doing so allows to use list.h as a generic list independently of the datatype, a node can belong only to one list.

Embedding pointers in a struct allows to have a node belong to multiple independent lists. The usage of the macros should be anyhow altered, forcing the programmer to specify the name of the list member. The type punning that we already do for lists allows to retrieve the position of the list via containerof easily.

According to the current development path, this won't be implemented.