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

Supertype to allow pointers to CircularBuffers of different sizes #35

Closed
sehrgut opened this issue Aug 4, 2020 · 1 comment
Closed

Comments

@sehrgut
Copy link

sehrgut commented Aug 4, 2020

In my application, I'm using CircularBuffer to implement a queue the size of which is determined by a child class, which enqueues items to be consumed by a parent-class method. It would be useful if CircularBuffer<T,S> implemented a parent class ICircularBuffer, allowing my parent class to hold a pointer to that type, while the size was managed by my child class (which knows S at compile-time).

Is this a feature you'd consider adding?

@rlogiacco
Copy link
Owner

I'm not sure why you can't achieve the same goal using composition rather than inheritance, anyways as the library strives for compactness I'm pretty sure the approach you suggest consumes a tiny bit more memory just to support a very specific requirement.
If you get your changes working in your own fork and the community proves me wrong regarding my corner case statement we might have your changes integrated.
For now, I prefer to keep the library as simple and compact as possible.

Nonetheless, I wish to thank you very much for the suggestion and for using this project.

Regards,
Roberto

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

No branches or pull requests

2 participants