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

Pool with RAII #890

Open
alxrMironov opened this issue May 7, 2024 · 1 comment
Open

Pool with RAII #890

alxrMironov opened this issue May 7, 2024 · 1 comment
Assignees

Comments

@alxrMironov
Copy link

alxrMironov commented May 7, 2024

Hello. The pool is pretty nice container in embedded systems.
But there is an issue - it is incompatiable with RAII concept. (as far as i understand, i may be totally wrong).

It is nice to have a pool class, what generate some sort of pointer wrappers to objects, what can be deleted only by call the pool method. Or maybe even with integrated deleter.

@jwellbelove
Copy link
Contributor

The problem is that the pool returns simple pointers or references to an object.
It's possible that you could wrap the returned object in an etl::unique_ptr with a custom deleter.
It may also be possible to add an additional member function that returns an etl::unique_ptr.

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

No branches or pull requests

2 participants