ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.04k stars 371 forks source link

Create CRTP LinkedList and Node #898

Open drewr95 opened 1 month ago

drewr95 commented 1 month ago

I've tried searching the documentation and couldn't find anything. I've created a CRTP-based LinkedList and Node that might be useful for this project.

It allows you to also have dynamic storage while not using the heap. I've created classes that inherit the Node and utilize RAII to add itself and remove itself from the linked list or a class that implements the linked list. Some places this could be used for is if you have a lot of similar objects. Example: You could have a TimerManager : LinkedList<TimerManager>and it handles ticking Timer : Node<Timer>. The Timer could utilize RAII by adding itself to the TimerManager and could remove itself upon destruction.

jwellbelove commented 1 month ago

That looks like an interesting concept