LWG3881 Incorrect formatting of container adapters backed by std::string
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG24c251d94daa: [libc++][format] Addresses LWG3881.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__format/container_adaptor.h | ||
---|---|---|
42 | Any reason why you're using ref_view instead of all_t? Those are not always equivalent -- is the difference not relevant? |
libcxx/include/__format/container_adaptor.h | ||
---|---|---|
42 | Mainly since that is what the wording in the LWG issue is. Victor's original proposed wording did use views::all_t. [2023-02-10 Tim provides updated wording] The container elements may not be const-formattable so we cannot use the const formatter unconditionally. Also the current wording is broken because an adaptor is not range and we cannot use fmt-maybe-const on the adaptor — only the underlying container. |
libcxx/include/__format/container_adaptor.h | ||
---|---|---|
42 | This is for passing a slightly disguised container into a function, not for view composition. It does not need the sometimes-by-reference-sometimes-by-copy-sometimes-ill-formed behavior of all_t. |
libcxx/include/__format/container_adaptor.h | ||
---|---|---|
42 | Thanks for the information. |
Any reason why you're using ref_view instead of all_t? Those are not always equivalent -- is the difference not relevant?