-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Open
Labels
formatC++20 std::format or std::print, and anything related to themC++20 std::format or std::print, and anything related to themlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
[format.range.formatter], Table 80:
(m option) Indicates that the opening bracket should be "{", the closing bracket should be "}", the separator should be ", ", and each range element should be formatted as if m were specified for its tuple-type.
Current implementation does not format range elements as if m tuple-type was specified, see for example https://godbolt.org/z/nzenfobqW:
#include <format>
#include <print>
#include <vector>
#include <utility>
int main() {
std::vector<std::pair<int, int>> v = {{1, 2}, {3, 4}, {5, 6}};
std::println("{:m}", v);
}Expected:
{1: 2, 3: 4, 5: 6}Got:
{(1, 2), (3, 4), (5, 6)}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatC++20 std::format or std::print, and anything related to themC++20 std::format or std::print, and anything related to themlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.