Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CRTP LinkedList and Node #898

Open
drewr95 opened this issue May 27, 2024 · 1 comment
Open

Create CRTP LinkedList and Node #898

drewr95 opened this issue May 27, 2024 · 1 comment

Comments

@drewr95
Copy link
Contributor

drewr95 commented May 27, 2024

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
Copy link
Contributor

That looks like an interesting concept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants