Skip to content
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

P2510 Formatting pointers #1165

Closed
wg21bot opened this issue Dec 18, 2021 · 11 comments · Fixed by cplusplus/draft#6354
Closed

P2510 Formatting pointers #1165

wg21bot opened this issue Dec 18, 2021 · 11 comments · Fixed by cplusplus/draft#6354
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. size - small paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Dec 18, 2021

P2510R0 Formatting pointers (Mark de Wever)

@wg21bot wg21bot added the LWG Library label Dec 18, 2021
@wg21bot wg21bot added this to the 2021-telecon milestone Dec 18, 2021
@JeffGarland JeffGarland added the LEWG Library Evolution label Dec 18, 2021
@brycelelbach brycelelbach added C++26 Targeted at C++26 B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e IS Ship vehicle: IS size - small paper size estimate ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list and removed LWG Library labels Dec 22, 2021
@jensmaurer jensmaurer modified the milestones: 2021-telecon, 2022-telecon Jan 1, 2022
@brycelelbach brycelelbach added C++23 Targeted at C++23 and removed C++26 Targeted at C++26 labels Feb 1, 2022
@brycelelbach
Copy link

Reclassified as C++23, as there are open LWG issues in this space - LWG3612 and LWG3644.

@inbal2l inbal2l added expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. and removed ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list labels Feb 10, 2022
@wg21bot
Copy link
Collaborator Author

wg21bot commented Mar 21, 2022

P2510R1 Formatting pointers (Mark de Wever)

@brycelelbach brycelelbach added ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review and removed expedited-library-evolution-electronic-poll Papers that were reviewed on the mailing list and then advanced directly to electronic polling. ready-for-library-evolution-mailing-list-review This paper needs to be discussed on the Library Evolution mailing list labels Apr 1, 2022
@inbal2l
Copy link
Collaborator

inbal2l commented Apr 1, 2022

Paper needs more discussion and was scheduled for LEWG telecon on 2022-05-03.

Summery of the mailing list review (started on Feb 10th, 2022):

  1. The functionality was supported:

    • I have had the need to format pointers in the various ways described in the paper on numerous occasions (except for locale considerations, but as an opt-in, I see no issue).
  2. On the other hand, there was some discussion on the necessity of the proposal:

    • I have a stronger need for seeing: std::println("at {:?p}", p); // '?' is introduced in http://wg21.link/p2286.
      output: at 00007ffb`a67fb331 myLib!myNs::SomeCls, Address is an identity of object in C++, so when printing an address, I want to see what is there.
      Author: The format specializations affected by this paper only format the types (const) void* and nullptr_t. (...) So the pointer has no information regarding the object type it points at, if any.
    • For the '0' and 'P' features, I am not opposed, but also not convinced to the usability of them.
  3. Using the locale mechanism got some objection:

    • Allowing locale-dependent printing of pointers in order to get a more readable representation seems a hack to me. If the user goal is a If the user goal is a more readable pointer representation, we should be providing a direct way to obtain it, not something that abuses the localization mechanism to achieve it indirectly.
    • As an option we could remove the more "controversial" locale part. '0' and 'P' seem OK and there were some requests for the former.
    • I am oposed to the paper introducing 'L' as valid specifier for pointers. Using it to get underscore is locale specific, and thus cannot be used in program that want to achieve this formatting in portable way.
  4. There was some discussion on the desired formatted output:

    • My preferred output when printing numbers in hexadecimal is 0x05D4; that is, the base prefix is lowercase 0x, but the number itself uses uppercase A-F. This is not a problem for numbers because I can just omit the # and add the base prefix by hand, e.g. 0x{:04X} instead of {:#06X}. But since # is implicit for pointers, this isn't (going to be) possible when using the P specifier.
      Suggestion: # when present will remove the base prefix, instead of adding it.
      Author: Currently # isn't allowed for pointers, so I don't see compatibility or implementation issues. I'll include it in the next version of the paper.
    • Can 'p' work on smart pointers?
      Author: There's a proposal https://wg21.link/p1636r2. But the paper hasn't been updated for a while. I'm not sure whether the author is still pursuing this.
    • What <format> can do to function pointers and pointers to member functions?
      Author: At the moment nothing, but this is an interesting question. I'll give this some more thought and since there's no support yet it's easier to consider adding debug information support from the start.
  5. There was a request for implementation.

@wg21bot
Copy link
Collaborator Author

wg21bot commented Apr 25, 2022

P2510R2 Formatting pointers (Mark de Wever)

@ben-craig
Copy link
Collaborator

P2510R2: Formatting pointers

P2510R2: Formatting pointers

2022-05-03 Library Evolution Telecon Minutes

Chair: Ben Craig

Minute Taker: Mark Hoemmenn

Champion: Mark de Wever

Summary

Prior to this meeting, this paper was targeting C++23 because it was related to a pair of LWG issues.
This paper is no longer entangled with those issues, and can now target C++26.

POLL: The # specifier should not be valid for pointers

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
2 8 1 3 0

Attendance: 22

# of Authors: 1

Author Position: WA

Outcome: Weak consensus in favor

POLL: Modify P2510R2 (Formatting pointers) by making the '#' specifier not valid for pointers, and then send the revised paper to LWG for C++26 classified as B2 (to be confirmed with a Library Evolution electronic poll).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
2 13 1 0 0

Attendance: 22

# of Authors: 1

Author Position: SF

Outcome: Strong consensus in favor

Next Steps

The author should revise the paper as directed, and await electronic polling results.

@wg21bot
Copy link
Collaborator Author

wg21bot commented May 24, 2022

P2510R3 Formatting pointers (Mark de Wever)

@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jun 2, 2022
@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Jun 29, 2022
@brycelelbach brycelelbach added C++26 Targeted at C++26 LWG Library lwg-pending LWG Chair needs to disposition and removed C++23 Targeted at C++23 LWG Library lwg-pending LWG Chair needs to disposition labels Jul 8, 2022
@brycelelbach
Copy link

2022-07 Library Evolution Electronic Poll Outcomes

Poll 1.10: Send [P2510R3] Formatting Pointers to Library Working Group for C++23, classified as an addition ([P0592R4] bucket 3 item).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
7 12 1 2 1

Outcome: Poll withdrawn due to incorrect ship vehicle. It will be retaken targeting C++26 in the next electronic polling period.

@brycelelbach brycelelbach added LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll and removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jul 22, 2022
@jwakely
Copy link
Member

jwakely commented Sep 6, 2022

Scheduled for LWG telecon tomorrow. See the mailing list for details.

@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Sep 23, 2022
@brycelelbach brycelelbach added LWG Library and removed LEWG Library Evolution ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Nov 8, 2022
@cor3ntin
Copy link

cor3ntin commented Nov 8, 2022

2022-10 Library Evolution Electronic Poll Outcomes

Send [P2510R3] Formatting Pointers to Library Working Group for C++26, classified as an addition ([P0592R4] bucket 3 item).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
6 9 1 0 1

Outcome: consensus in favor.

@JeffGarland
Copy link
Member

Update from earlier:

https://wiki.edg.com/bin/view/Wg21telecons2022/P2510-20220907

poll: put P2510R3 in c++26

F A N
9 0 0

@JeffGarland JeffGarland added the lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting label Feb 7, 2023
@JeffGarland JeffGarland added the tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. label May 23, 2023
@JeffGarland JeffGarland removed the lwg-future-plenary ready to go to plenary but working draft isn't open so we are waiting label Jun 13, 2023
@cor3ntin cor3ntin added plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. and removed tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. size - small paper size estimate
Projects
Status: Tentatively Ready
Development

Successfully merging a pull request may close this issue.

8 participants