-
Notifications
You must be signed in to change notification settings - Fork 1.6k
_Node_handle: destroy with value_type allocator #1310
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
Drive-by cleanup: * explicitly compare pointers with `nullptr` in preference to `if (ptr)` and `if (!ptr)` * `_STL_INTERNAL_CHECK` checkable preconditions * Use `constinit` when available to verify `constexpr` constructor Fixes microsoft#1309.
|
This is also inconsistent with what we do everywhere else in the node-based containers, for example Line 317 in 5f3e912
|
On the contrary; this introduces an extra rebind to support what the Standard explicitly requires in [container.node.cons]/3.1 and [container.node.dtor]/1. |
|
I see, so the standard does say that the type needs to match. We make no attempt to do that right now; all construct and destroy calls should probably be audited for this in the node based containers. |
The quoted paragraphs have nothing to do with nodes stored in node-based containers, they only describe the behavior of |
I view it as a serious problem if construct and destroy do not match the ones the container used. |
IMO you're asking for trouble If construct and destroy don't have the same behavior within a rebind family. |
I mean, I agree, but that argues to not do the rebind. |
StephanTLavavej
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - I found a couple of potential clarity improvements in the test. I'll verify whether they actually compile; if so, I'll push changes.
Changes two pre-existing occurrences of double-braced sets.
|
🦶 : bug smashed. |
Drive-by cleanup:
nullptrin preference toif (ptr)andif (!ptr)_STL_INTERNAL_CHECKcheckable preconditionsconstinitwhen available to verifyconstexprconstructorFixes #1309.