Skip to content

Conversation

fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jun 14, 2021

Fixes #1988

@fsb4000 fsb4000 requested a review from a team as a code owner June 14, 2021 05:07
Copy link
Contributor

@barcharcraz barcharcraz left a 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)

@@ -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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Member

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:

STL/stl/inc/yvals_core.h

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephanTLavavej StephanTLavavej self-assigned this Jun 24, 2021
@StephanTLavavej

This comment has been minimized.

@StephanTLavavej StephanTLavavej merged commit e745bad into microsoft:main Jun 29, 2021
@StephanTLavavej
Copy link
Member

Thanks for implementing this removal, which will help avoid confusing programmers! 🎉 🎉 🎉

@fsb4000 fsb4000 deleted the fix1988 branch June 29, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2186R2 Removing Garbage Collection Support
5 participants