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

Add a buffer type for non-default-constructible types #59

Closed
Morwenn opened this issue Mar 6, 2016 · 1 comment
Closed

Add a buffer type for non-default-constructible types #59

Morwenn opened this issue Mar 6, 2016 · 1 comment

Comments

@Morwenn
Copy link
Owner

Morwenn commented Mar 6, 2016

The current buffer providers fixed_buffer and dynamic_buffer are fine for simple tasks, but they can't handle types that don't have a default constructor, and I guess they can't handle proxy iterators either. We need a new dynamic buffer type that allows that. It probably means that a chunk a raw memory would be allocated, and every element should be associated to a boolean to know whether a type has already been constructed or not. Also, it should properly handle cleaning of resources when destructed.

Such a buffer could also be optimized thanks to traits such as std::is_trivially_destructible and friends once the basic features are there. It would allow to lower the otherwise rather expensive cost of the buffer provider when possible.

I gave it some more thought and tried to implement the thing. However, it seems that such a feature would need something akin to operator. to work properly and handle all the use cases in the library. The buffered sorters would also have to be modified so that they can handle arbitrary iterator types from the buffer providers rather than only pointers.

@Morwenn
Copy link
Owner Author

Morwenn commented May 24, 2021

Superseded by #188.

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
@Morwenn and others