-
Notifications
You must be signed in to change notification settings - Fork 33
Add GNATCOLL.Refcount.Limited_Shared_Pointers. #107
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
base: master
Are you sure you want to change the base?
Conversation
This is a copy of Shared_Pointers except Set takes an anonymous function pointer instead of a value directly. This allows for the generic element type to be a limited type.
|
It might make sense to have |
|
Hi @liampwll, thanks for your contribution! The current PR duplicates too much code to remain maintainable. Your suggestion of having Could you also add tests to your PR, especially one that attempts to copy a limited version of the shared element? As for the inlining performance issue, we can run benchmarks afterwards. If that may help you, here is the main I used to test your MR: |
|
Hi, I currently have a Problem also requiring a "Limited Holder" for my solution i used something like: A litle more flexible version might be something like this: Both of these aproches offer the additional benefit of initializing the element with some data. |
I'm not really sure what you mean by this. The approaches above feel like an extra level of OO that might fit in to the style of a specific project but don't have any universal benefit, so it seems like it would be better for them to be implemented by a given user of GNATCOLL while leaving the underlying implementation as simple as possible. |
This is a copy of Shared_Pointers except Set takes an anonymous function pointer instead of a value directly. This allows for the generic element type to be a limited type.