phobos
phobos copied to clipboard
Add `TailShared` to `std.traits`
While working on some thread-safe code, I felt an easy way to unshare just the head of a type was missing. But when looking at the docs of core.atomic
I saw references to TailShared, which happens to do just that, but is private to that module.
Now I could propose to make it public there... but it actually it hasn't much to do with atomicity, so core.atomic
did not feel like the right place to me. I'd look in std.traits
first for a thing like that. But moving it there is also wrong, because druntime should not depend on phobos.
So I decided to let std.traits
steal it from core.atomic
. A bit ugly in implementation, but I think it results in the best API.
Thanks for your pull request and interest in making D better, @thaven! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:
andReturns:
)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.