Skip to content

Commit 13c5095

Browse files
authored
Merge 2023-11 LWG Motion 6
P2918R2 Runtime format strings II
2 parents 2352e4c + 19911ff commit 13c5095

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@
632632
#define @\defnlibxname{cpp_lib_filesystem}@ 201703L // also in \libheader{filesystem}
633633
#define @\defnlibxname{cpp_lib_flat_map}@ 202207L // also in \libheader{flat_map}
634634
#define @\defnlibxname{cpp_lib_flat_set}@ 202207L // also in \libheader{flat_set}
635-
#define @\defnlibxname{cpp_lib_format}@ 202306L // also in \libheader{format}
635+
#define @\defnlibxname{cpp_lib_format}@ 202311L // also in \libheader{format}
636636
#define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format}
637637
#define @\defnlibxname{cpp_lib_formatters}@ 202302L // also in \libheader{stacktrace}, \libheader{thread}
638638
#define @\defnlibxname{cpp_lib_forward_like}@ 202207L // freestanding, also in \libheader{utility}

source/utilities.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15583,6 +15583,17 @@
1558315583
template<class charT, class... Args>
1558415584
struct basic_format_string;
1558515585

15586+
template<class charT> struct @\exposid{runtime-format-string}@ { // \expos
15587+
private:
15588+
basic_string_view<charT> @\exposid{str}@; // \expos
15589+
public:
15590+
@\exposid{runtime-format-string}@(basic_string_view<charT> s) noexcept : @\exposid{str}@(s) {}
15591+
@\exposid{runtime-format-string}@(const @\exposid{runtime-format-string}@&) = delete;
15592+
@\exposid{runtime-format-string}@& operator=(const @\exposid{runtime-format-string}@&) = delete;
15593+
};
15594+
@\exposid{runtime-format-string}@<char> runtime_format(string_view fmt) noexcept { return fmt; }
15595+
@\exposid{runtime-format-string}@<wchar_t> runtime_format(wstring_view fmt) noexcept { return fmt; }
15596+
1558615597
template<class... Args>
1558715598
using @\libglobal{format_string}@ = basic_format_string<char, type_identity_t<Args>...>;
1558815599
template<class... Args>
@@ -16485,6 +16496,7 @@
1648516496

1648616497
public:
1648716498
template<class T> consteval basic_format_string(const T& s);
16499+
basic_format_string(@\exposid{runtime-format-string}@<charT> s) noexcept : str(s.@\exposid{str}@) {}
1648816500

1648916501
constexpr basic_string_view<charT> get() const noexcept { return @\exposid{str}@; }
1649016502
};

0 commit comments

Comments
 (0)