Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++20 status.

3327. Format alignment specifiers vs. text direction

Section: 28.5.2.2[format.string.std]Status:C++20Submitter: Great BritainOpened: 2019-11-07Last modified: 2021-02-25

Priority:0

View otheractive issues in [format.string.std].

View all otherissues in [format.string.std].

View all issues withC++20 status.

Discussion:

AddressesGB 225

std::format() alignment specifiers should be independent of text directionThe align specifiers for formatting standard integer and string types are expressed interms of "left" and "right". However, "left alignment" as currently defined in theformat() specification might end up being right-aligned when the resulting string is displayed in a RTL or bidirectional locale. This ambiguity can be resolved by removing "left" and "right" and replacing with "start" and "end", without changing any existing implementation and without changing the intent of the feature.

Proposed change:

In [tab:format.align]:Forces the field to beleft-aligned withinaligned to the start ofthe available space and Forces the field to beright-aligned withinaligned to the end of the available space

Jeff Garland:

Wiki notes from Belfast Wed:

# GB225

JG: SG16 approved this.

JG: If you scroll back up, you'll see see it's very tiny. Two line change.

JG: I'm willing to submit an LWG issue to suggest we make a wording change to take it off our plate.

CC: Is this the one that changes left/right to beginning/end?

Some people: yes

MC: Any problem with Jeff's proposed direction and this proposed fix?

MC: I hear none.

[2019-11 Moved to Ready on Friday AM in Belfast]

Proposed resolution:

This wording is relative toN4835.

  1. Modify "Table 57 — Meaning ofalign options" [tab:format.align] as indicated:

    Table 57 — Meaning ofalign options [tab:format.align]
    OptionMeaning
    <Forces the field to beleft-aligned withinaligned to the start of the available space. This is the default for non-arithmetic types,charT, andbool, unless an integer presentation type is specified.
    >Forces the field to beright-aligned withinaligned to the end of the available space. This is the default for arithmetic types other thancharT andbool or when an integer presentation type is specified.
    […]

[8]ページ先頭

©2009-2026 Movatter.jp