-
-
Notifications
You must be signed in to change notification settings - Fork 707
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 std.typecons.Rebindable2 for internal use. #8768
Add std.typecons.Rebindable2 for internal use. #8768
Conversation
Rebindable2 is a simplified version of std.typecons.Rebindable that clears up every special case: classes, arrays and structs now have the same struct. Whichever type you instantiate `Rebindable2` with, you always get the same type out by calling `value.get` on the resulting container. Also use this type to simplify the parts of Phobos we previously used `Rebindable` for.
Thanks for your pull request and interest in making D better, @FeepingCreature! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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 referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#8768" |
We need a better name than |
The thing is that Rebindable is genuinely a really good name for this type. You bind a value to a name when declaring a variable; Rebindable lets you dissolve that association and bind a new value to the same name. |
Since the symbol isn't |
Non-mutable `class` is another case where `Rebindable` just silently aliases itself away. Don't sweat that this looks ugly - this is fixed on `master` via the `Rebindable2` rewrite dlang#8768
Non-const `class` is another case where `Rebindable` just silently aliases itself away. Don't sweat that this looks ugly - this is fixed on `master` via the `Rebindable2` rewrite dlang#8768
… `Rebindable` did in fact alias itself away. This looks ugly, but it's just for the `stable` branch - this is fixed on `master` via the `Rebindable2` rewrite dlang#8768
… `Rebindable` did in fact alias itself away. This looks ugly, but it's just for the `stable` branch - this is fixed on `master` via the `Rebindable2` rewrite #8768
Rebindable2
is a simplified version ofstd.typecons.Rebindable
that cleans up every special case: classes, arrays and structs now have the samestruct Rebindable2
.Whichever type you instantiate
Rebindable2
with, you always get the same type out by callingvalue.get
on the resulting container.Also use this type to simplify the parts of Phobos I previously used
Rebindable
for.This PR is the announced follow-up to #8735