On Thursday, February 10th, 2022 at 3:40 PM, Inbal Levi via Lib-Ext <lib-ext@lists.isocpp.org> wrote:


P2510R0: Formatting pointers
From the Abstract:
[...] This paper aims to make formatting pointer types more useful, reducing the need for users to write their own formatters or casting a pointer type to an integer type.

The argument "pointer types should
share the same amount of formatting
options as as integers" is undefended.

To explain what do I mean -- 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. I hope we can build
the understanding of pointers != integers
after http://wg21.link/p2318 (provenance-
aware memory object model).

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________