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
[range.dangling] The tag
of a struct
is not a C++ term
#5922
Conversation
Only in C is the term `tag` defined with respect to `struct`s. Replace the term "tag type" with simply "type" in [range.dangling].
This isn't talking about "the tag of a struct" though. It's a tag type as in "tag dispatching" https://www.fluentcpp.com/2018/04/27/tag-dispatching/ |
I assumed that's *how* it was ultimately being used, there was just not
enough context for me to solidify my sense. Do you think it's worth making
that clear?
…On Sat, Oct 29, 2022 at 3:18 AM Jonathan Wakely ***@***.***> wrote:
https://www.boost.org/community/generic_programming.html#tag_dispatching
—
Reply to this email directly, view it on GitHub
<#5922 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCP2CRB3WEQJG67WZOXDIDWFTFTPANCNFSM6AAAAAARRTHYMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Upon further reflection, I still believe this is a good change to make. I am also concerned by the sentence
which seems to conflate returning a type with returning an object of a certain type. It seems to me that this would be better phrased as
|
There's no object involved in |
Thank you! I completely understand. My point was simply that it seems a bit
inaccurate to leave the language the way it is. Do you agree?
…On Sat, Oct 29, 2022 at 5:57 PM Johel Ernesto Guerrero Peña < ***@***.***> wrote:
There's no object involved in return dangling{};. See
https://eel.is/c++draft/stmt.return#2.sentence-4 and
https://wg21.link/LWG3805.
—
Reply to this email directly, view it on GitHub
<#5922 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCP2CT335DTIIYILFOO6LTWFWMTZANCNFSM6AAAAAARRTHYMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It will be interesting to see the resolution to the issue that you have open! |
I'm not sure. There's also the example of https://eel.is/c++draft/std.iterator.tags#1.sentence-2. |
Oh! That's exactly what we want here, then!
…On Sat, Oct 29, 2022 at 6:56 PM Johel Ernesto Guerrero Peña ***@***.***> wrote:
I'm not sure. There's also the example of https://eel.is/c++draft/std.iterator.tags#1.sentence-2.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Well, maybe not *exactly* what we want. But, I think it highlights the
fact that we want to say something more than just "type" in this
sentence. Would you agree with that?
…On Sat, Oct 29, 2022 at 6:57 PM Will Hawkins ***@***.***> wrote:
Oh! That's exactly what we want here, then!
On Sat, Oct 29, 2022 at 6:56 PM Johel Ernesto Guerrero Peña
***@***.***> wrote:
>
> I'm not sure. There's also the example of https://eel.is/c++draft/std.iterator.tags#1.sentence-2.
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you authored the thread.Message ID: ***@***.***>
|
It already does. It says "tag type". |
Which is a term not defined anywhere else in the standard. Worse, it echoes
the definition of tag from C in the context of `struct`s.
That said, I am not trying to argue and I don't mean to question your
expertise. I am just trying to be helpful.
If I can continue to refine the language, let me know. Otherwise, I'll let
it be.
…On Sat, Oct 29, 2022 at 7:06 PM Johel Ernesto Guerrero Peña < ***@***.***> wrote:
It already does. It says "tag type".
—
Reply to this email directly, view it on GitHub
<#5922 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCP2CUXY7IAX6NVKKJWOLTWFWUYLANCNFSM6AAAAAARRTHYMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
We all are. Obviously, the "something more" you meant wasn't the preexisting "tag". I shouldn't have taken it literally. Now I'm questioning the use of "tag" standing for "tag dispatching". Unlike the iterator's tag dispatching, this one is on the way out. And the tag is actually "whether the range argument is an rvalue", whereas The
you suggest exists in the whole paragraph, which attempts to explain what "tag" alone couldn't. So I think just dropping "tag" is an improvement in face of the potential confusion with the C term and "tag" as an adjective being an undefined term for types. |
No problem! I get nervous in these situations because everyone else is the expert!
If I hear you correctly, then you think that the original PR (where we simply drop the tag word) is good? Thanks again for engaging! |
I personally do. We'll have to see what the experts think. |
Fair enough, but I think you're an expert! :-) |
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 looks like an improvement to me, because it avoids the confusion with C struct tags. And it's not an iterator category tag, either (for tag dispatching).
@jwakely , what do you think?
Thank you, @jensmaurer
…On Sun, Oct 30, 2022 at 1:59 AM Jens Maurer ***@***.***> wrote:
***@***.**** approved this pull request.
This looks like an improvement to me, because it avoids the confusion with
C struct tags. And it's not an iterator category tag, either (for tag
dispatching).
@jwakely <https://github.com/jwakely> , what do you think?
—
Reply to this email directly, view it on GitHub
<#5922 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCP2CVJHB7OSBGXNTWU423WFX6CLANCNFSM6AAAAAARRTHYMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.
"tag" really isn't contributing anything here.
Thank you @CaseyCarter ! |
Iterator tags aren't the only kind of tags used for tag dispatching though. I'd prefer to keep it, but then we'd have to define tag dispatching (or tag types) in the standard. So I will let it go, somewhat reluctantly. |
I'd be willing to work with you on defining that phrase and introducing it, if you'd like!! @jwakely |
(While I understand the type |
@tkoeppe , on to you. |
Calling another algorithm with the result either dispatches to a function taking an iterator, or fails to compile (i.e. dispatches to nothing). Using the return type to select a valid overload or an invalid overload is a form of tag dispatching IMO. |
Only in C is the term
tag
defined with respect tostruct
s. Replace the term "tag type" with simply "type" in [range.dangling].