Page MenuHomePhabricator

[libc++] Removes __cpp_lib_monadic_optional.
ClosedPublic

Authored by Mordante on May 17 2022, 10:21 AM.

Details

Reviewers
philnik
ldionne
Group Reviewers
Restricted Project
Commits
rG9e5c293492a7: [libc++] Removes __cpp_lib_monadic_optional.
Summary

P0798R8 "Monadic operations for std::optional" has been implemented, so
this LWG issue can be adopted.

During review it was discovered another paper bumped the macro. The
part affecting optional of this paper is done, the variant isn't. The
status page is updated to reflect the current state.

Implements

  • LWG 3621 Remove feature-test macro __cpp_lib_monadic_optional

Updates status of

  • P2231R1 Missing constexpr in std::optional and std::variant

Diff Detail

Event Timeline

Mordante created this revision.May 17 2022, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 10:21 AM
Herald added a subscriber: arichardson. · View Herald Transcript
Mordante requested review of this revision.May 17 2022, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 10:21 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik added inline comments.
libcxx/utils/generate_feature_test_macro_components.py
496

The LWG issue says that 202106L is replaced with 202110L. Do you know what 202106L is?

Mordante marked an inline comment as done.May 17 2022, 10:54 AM
Mordante added inline comments.
libcxx/utils/generate_feature_test_macro_components.py
496

ISO Standards only have one version, when a new version is released older versions are obsolete. In C++17 optional was added to the Standard with 202106L (I didn't validate that). Now the Standard updates it to 202110L. In libc++ we still want to use 202106L when compiled with C++17 or C++20. When the user uses C++2b it should be 202110L.

The same happened to __cpp_lib_string_view.

philnik added inline comments.May 17 2022, 10:56 AM
libcxx/utils/generate_feature_test_macro_components.py
496

I understand that part. I wanted to know if we have implemented the feature that bumped the version to 202106L.

Mordante marked 2 inline comments as done.May 17 2022, 11:11 AM
Mordante added inline comments.
libcxx/utils/generate_feature_test_macro_components.py
496

I assume you mean bumped to 202110L. In D113408 you implemented it ;-)

Mordante updated this revision to Diff 430149.May 17 2022, 12:04 PM
Mordante marked an inline comment as done.

Addresses review comment.
It seems optional had another change in C++20. This change was done, but not
marked as complete since the same paper also updates variant, which hasn't been
implemented yet.

Mordante edited the summary of this revision. (Show Details)May 17 2022, 12:07 PM
philnik accepted this revision as: philnik.May 17 2022, 12:09 PM

LGTM with CI passing.

ldionne accepted this revision.Tue, May 31, 9:45 AM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/include/optional
96

Those are conditionally explicit, so we should either use EXPLICIT or explicit(see-below) to show that they are not just explicit.

This revision is now accepted and ready to land.Tue, May 31, 9:45 AM
philnik added inline comments.Tue, May 31, 9:48 AM
libcxx/include/optional
96

I think explicit(see-below) is the way to go here. I never would have guessed that EXPLICIT says that the explicit is conditional.

Mordante marked 2 inline comments as done.Tue, May 31, 10:17 AM

Thanks for the review!

This revision was automatically updated to reflect the committed changes.