Skip to content

Commit 7fe571a

Browse files
committed
String formatting overhaul: Format according to std::format specs
The previous commit added support for (nearly) fully compliant parsing of the new std::format style of string. This implements the actual formatting of strings according to this format. The following features are not yet supported: 1. Nested replacement fields (see previous commit). 2. Center alignment - will be treated as type-default alignment for now. 3. Wide-to-narrow character validation - a simple static_cast is used. To support all formatting options, a few helper facets are added. These are a facet to use a space in place of a positive sign, and a facet to format a value as a binary value (because there isn't a standard binary manipulator such as std::bin). This also drops BasicString::create_hex_string. This method was needed because the old formatting implementation did not support fixed-width hexadecimal formatting, but now e.g. format("{:2x}", 0x4) will suffice.
1 parent ef2cf31 commit 7fe571a

File tree

8 files changed

+1143
-621
lines changed

8 files changed

+1143
-621
lines changed

build/nix/flags.mk

+1-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ ifeq ($(toolchain), clang)
102102
else ifeq ($(toolchain), gcc)
103103
CF_ALL += \
104104
-Wnull-dereference \
105-
-Wredundant-decls \
106-
-Wsign-promo
105+
-Wredundant-decls
107106

108107
ifeq ($(SYSTEM), LINUX)
109108
CF_ALL += \

0 commit comments

Comments
 (0)