-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement P2186R2 Removing Garbage Collection Support #2010
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
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.
Thanks for the PR!
The removal of the feature should be controlled in the same was as we do for features removed in CXX20
See yvals_core.h starting around line 1061 (search for _HAS_FEATURES_REMOVED_IN_CXX20
)
tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Casey Carter <[email protected]>
@@ -1116,6 +1117,16 @@ | |||
#define _HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 (_HAS_FEATURES_REMOVED_IN_CXX20) | |||
#endif // _HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 | |||
|
|||
|
|||
#ifndef _HAS_FEATURES_REMOVED_IN_CXX23 | |||
#define _HAS_FEATURES_REMOVED_IN_CXX23 (!_HAS_CXX23) |
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.
Is that correct. The default would be that those Features are removed.
Semantically this appears to be flipped
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.
Same as https://github.com/microsoft/STL/blob/main/stl/inc/yvals_core.h#L1060-L1063
Yes. I think it's correct. It's name for users. If I as user define
#define _HAS_FEATURES_REMOVED_IN_CXX23 1
then include some standard hearders
and then all deleted features in c++23 are available for me.
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.
Yep, this is correct.
FYI: GitHub doesn't preview line-numbered links to files in main
, because as main
changes, the line numbers could be invalidated. However, if you press the y
keyboard shortcut when viewing a file, the link will transform into a commit permalink, and then citing that in an issue/comment will be previewed. Here, https://github.com/microsoft/STL/blob/1866b848f0175c3361a916680a4318e7f0cc5482/stl/inc/yvals_core.h#L1060-L1063
will be previewed as:
Lines 1060 to 1063 in 1866b84
// P0619R4 Removing C++17-Deprecated Features | |
#ifndef _HAS_FEATURES_REMOVED_IN_CXX20 | |
#define _HAS_FEATURES_REMOVED_IN_CXX20 (!_HAS_CXX20) | |
#endif // _HAS_FEATURES_REMOVED_IN_CXX20 |
@@ -961,8 +961,10 @@ void memory_test() { | |||
default_delete<int[]> dd1{default_delete<int[]>{}}; | |||
dd1(new int[5]); | |||
|
|||
#if _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23 |
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.
Same, I would have expected those to be there if they have not been deleted
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.
This comment has been minimized.
This comment has been minimized.
Thanks for implementing this removal, which will help avoid confusing programmers! 🎉 🎉 🎉 |
Fixes #1988