-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use unqualified function calls for valarray #286
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.
[valarray,transcend]/1 is not the clearest paragraph of wording in the Standard. This paragraph came up while discussing Revision 2 of WG21-P1719 which changes the Requires to Mandates in LWG last week. We determined (1) this wording unclear, (2) we're not extremely motivated to cleanup valarray
wording, and (3) we can't devise a sensible reading for this wording other than that it intends unqualified invocations which result in ADL.
TLDR: I agree with the intent of the P/R and agree it addresses the issue.
e58c5a6
to
03236bf
Compare
The transcend functions require that the function is applied unqualified to each element
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 modulo test coverage; we should have a test to validate the library finds functions via ADL.
Other maintainers: Should we comment these callsites to make it clear these unqualified calls are intentional?
/azp run EDIT: Woops - I forgot the checks are now automatic and I don't need to poke the bot. |
Azure Pipelines successfully started running 1 pipeline(s). |
This is sufficiently unusual that I think comments are warranted, yes. |
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 went ahead and added comments, following the precedent of
Line 122 in f9b1dcc
*this = make_error_code(_Errcode); // using ADL |
I don't think test coverage for this is necessary; we'd have to write "fancy numeric types". The comments should be sufficient to ensure that we don't add qualification during maintenance.
I'm porting this to MSVC-internal git now, thanks. |
Thanks again for the bugfix! :-) |
Description
The standard requires that the transcend functions that are applied unqualified to each element of
valarray
.This addresses #285
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Ugly
as perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft as a reference (and any other cited standards).
If they were derived from a project that's already listed in NOTICE.txt,
that's fine, but please mention it. If they were derived from any other
project (including Boost and libc++, which are not yet listed in
NOTICE.txt), you must mention it here, so we can determine whether the
license is compatible and what else needs to be done.