Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[format.string.std] Fix example #6531

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15901,8 +15901,6 @@
The \fmtgrammarterm{align} option applies to all argument types.
The meaning of the various alignment options is as specified in \tref{format.align}.
\begin{example}
%FIXME: example is incomplete, sB and sC result in:
%Error: Invalid UTF-8 byte sequence.
\begin{codeblock}
char c = 120;
string s0 = format("{:6}", 42); // value of \tcode{s0} is \tcode{"\ \ \ \ 42"}
Expand All @@ -15916,8 +15914,8 @@
string s8 = format("{:02}", 1234); // value of \tcode{s8} is \tcode{"1234"}
string s9 = format("{:*<}", "12"); // value of \tcode{s9} is \tcode{"12"}
string sA = format("{:*<6}", "12345678"); // value of \tcode{sA} is \tcode{"12345678"}
string sB = format("{:@\importexample[-2pt]{example_05}\caret{}@6}", "x"); // value of \tcode{sB} is \tcode{"\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}x\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}"}
string sC = format("{:*@\caret{}@6}", "@\importexample[-2pt]{example_05}@"); // value of \tcode{sC} is \tcode{"\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}"}
string sB = format("{:@\importexample[-2pt]{example_05}\kern0.75pt\caret{}@6}", "x"); // value of \tcode{sB} is \tcode{"\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}x\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}"}
string sC = format("{:*@\caret{}@6}", "@\importexample[-2pt]{example_05}\kern0.75pt\importexample[-2pt]{example_05}\kern0.75pt\importexample[-2pt]{example_05}\kern0.75pt@"); // value of \tcode{sC} is \tcode{"\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}\importexample[-2pt]{example_05}"}
\end{codeblock}
\end{example}
\begin{note}
Expand Down Expand Up @@ -17139,9 +17137,6 @@
then \placeholder{C} is appended unchanged.
\end{itemize}

%% FIXME: Example is incomplete; s2 and s6 from P2286R8
%% and s8 (which should be s9) from P2713R1 are missing below;
%% FIXME: their Unicode characters are not available in our font (Latin Modern).
\begin{example}
\begin{codeblock}
string s0 = format("[{}]", "h\tllo"); // \tcode{s0} has value: \tcode{[h\ \ \ \ llo]}
Expand Down