-
-
Notifications
You must be signed in to change notification settings - Fork 387
Deprecate class allocators and deallocators #2277
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
Conversation
|
Thanks for your pull request, @JinShil! 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. |
|
So we recently found |
Please elaborate. |
|
|
So the application there is you can force users to go through your custom factory functions, or in the case of structs, put them on the stack (or bypass with memcpy lol). |
|
See dlang/phobos#6003 for an example. |
|
I've added support for the syntax |
|
That sounds good to me! |
Great! If you don't mind, and truly approve of this PR, please take the explicit step of marking it "Approved". |
|
oh lol i keep forgetting i actually have some power in this repo. I don't have such power over on the dmd side though. |
I still think it's helpful to mark PRs "approved" even in repos where you may not have merge rights. It helps to know that it was reviewed and scrutinized by anyone with D language skills, especially a veteran like yourself. |
|
Shouldn't this PR remove or mark as deprecated the respective sections in the spec too? |
The spec already states the following for allocators:
... and the following for class deallocators
I remember a brief discussion we had with one of the other deprecations in 2.079 to leave the spec in tact until removal (See #1941 (comment)) so users could still refer to it when updating their code. Therefore, since the spec has already marked allocators and deallocators as deprecated, I think the spec should be left as is until removal. |
|
Ping! DMD PR was merged. |
deletewas deprecated in 2.079. Before thedeletekeyword can be removed it will be necessary to also deprecate and remove class allocators and deallocators. They have been planned for deprecation for years; this PR finally puts the deprecation process in motion.See https://dlang.org/deprecate.html#Class%20allocators%20and%20deallocators
DMD PR: dlang/dmd#8042