Skip to content

[lib] Replace uses of add_meow_t with plain cv-qualifiers #7851

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

frederick-vs-ja
Copy link
Contributor

...except for [tab:meta.trans.cv]. Because the wording change for add_cv seems a bit non-trivial.

Fixes #7845.

...except for [tab:meta.trans.cv]. Because the wording change for
`add_cv` seems a bit non-trivial.
@Eisenwave
Copy link
Contributor

There may be additional uses of std::add_lvalue_reference or std::add_pointer which aren't needed, but that's probably best done in a different PR. It's also less obvious whether the uses of those traits are pointless because they have some special behavior.

@jensmaurer
Copy link
Member

There may be additional uses of std::add_lvalue_reference or std::add_pointer...

Those should not be in this pull request.

@frederick-vs-ja
Copy link
Contributor Author

frederick-vs-ja commented Apr 24, 2025

There may be additional uses of std::add_lvalue_reference or std::add_pointer which aren't needed, but that's probably best done in a different PR. It's also less obvious whether the uses of those traits are pointless because they have some special behavior.

I believe that LWG4144 made uses of add_lvalue_reference_t pointless for unique_ptr. (Edit: This seems to be wrong, per this demo.) For the example in [exec.util.cmplsig.trans]/2, I think the use of add_lvalue_reference_t is also pointless, although add_lvalue_reference_t seems able to trigger more "accept-invalid" compiler bugs.

Other uses of add_lvalue_reference_t are meaningful since they handle std::common_with<void, void>.

For add_pointer_t, most uses are meaningful because they remove references. Its uses in std::get_if overloads are possibly meaningful but squirrelly when invalid variant specializations are involved (Godbolt link). Perhaps an LWG issue is necessary for this.

@@ -63,7 +63,7 @@

// \ref{utility.as.const}, \tcode{as_const}
template<class T>
constexpr add_const_t<T>& as_const(T& t) noexcept;
constexpr const T& as_const(T& t) noexcept;
Copy link
Member

Choose a reason for hiding this comment

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

This changes the mangled name for std::as_const specializations, but I don't think we need to care about that.

Copy link
Member

Choose a reason for hiding this comment

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

It is a normative change though, so not editorial.

Copy link
Member

@jensmaurer jensmaurer Apr 24, 2025

Choose a reason for hiding this comment

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

Understood; @frederick-vs-ja , please remove this change from the present editorial pull request and (at your option) create an LWG issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted.

@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes to the wording or approach have been requested and not yet applied.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add_const_t VS plain const
4 participants