Skip to content

Commit 8077355

Browse files
mclowzygoloid
authored andcommitted
P1720R2 Mandating the Standard Library: Clause 28 - Localization library
1 parent 06e0b95 commit 8077355

File tree

1 file changed

+39
-68
lines changed

1 file changed

+39
-68
lines changed

source/locales.tex

Lines changed: 39 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
template<class Facet> locale combine(const locale& other) const;
141141

142142
// locale operations
143-
basic_string<char> name() const;
143+
string name() const;
144144

145145
bool operator==(const locale& other) const;
146146

@@ -573,9 +573,6 @@
573573
\end{itemdecl}
574574

575575
\begin{itemdescr}
576-
\pnum
577-
Default constructor: a snapshot of the current global locale.
578-
579576
\pnum
580577
\effects
581578
Constructs a copy of the argument last passed to
@@ -584,24 +581,12 @@
584581
function semantics identical to those of
585582
\tcode{locale::classic()}.
586583
\begin{note}
587-
This constructor is commonly used as the default value for arguments
588-
of functions that take a
589-
\tcode{const locale\&}
590-
argument.
584+
This constructor yields a copy of the current global locale.
585+
It is commonly used as a default argument for
586+
function parameters of type \tcode{const locale\&}.
591587
\end{note}
592588
\end{itemdescr}
593589

594-
\indexlibraryctor{locale}%
595-
\begin{itemdecl}
596-
locale(const locale& other) noexcept;
597-
\end{itemdecl}
598-
599-
\begin{itemdescr}
600-
\pnum
601-
\effects
602-
Constructs a locale which is a copy of \tcode{other}.
603-
\end{itemdescr}
604-
605590
\indexlibraryctor{locale}%
606591
\begin{itemdecl}
607592
explicit locale(const char* std_name);
@@ -728,16 +713,6 @@
728713
\tcode{*this}.
729714
\end{itemdescr}
730715

731-
\indexlibrarydtor{locale}%
732-
\begin{itemdecl}
733-
~locale();
734-
\end{itemdecl}
735-
736-
\begin{itemdescr}
737-
\pnum
738-
A non-virtual destructor that throws no exceptions.
739-
\end{itemdescr}
740-
741716
\rSec3[locale.members]{Members}
742717

743718
\indexlibrarymember{locale}{combine}%
@@ -774,7 +749,7 @@
774749

775750
\indexlibrarymember{locale}{name}%
776751
\begin{itemdecl}
777-
basic_string<char> name() const;
752+
string name() const;
778753
\end{itemdecl}
779754

780755
\begin{itemdescr}
@@ -852,11 +827,9 @@
852827
\end{itemdecl}
853828

854829
\begin{itemdescr}
855-
\pnum
856-
Sets the global locale to its argument.
857-
858830
\pnum
859831
\effects
832+
Sets the global locale to its argument.
860833
Causes future calls to the constructor
861834
\tcode{locale()}
862835
to return a copy of the argument.
@@ -866,9 +839,12 @@
866839
\end{codeblock}
867840
otherwise, the effect on the C locale, if any, is \impldef{effect on C locale of calling
868841
\tcode{locale::global}}.
842+
843+
\pnum
844+
\remarks
869845
No library function other than
870846
\tcode{locale::global()}
871-
shall affect the value returned by
847+
affects the value returned by
872848
\tcode{locale()}.
873849
\begin{note}
874850
See~\ref{c.locales} for data race considerations when
@@ -910,7 +886,7 @@
910886

911887
\begin{itemdescr}
912888
\pnum
913-
\requires
889+
\mandates
914890
\tcode{Facet}
915891
is a facet class whose definition contains the public static member
916892
\tcode{id}
@@ -1605,10 +1581,8 @@
16051581

16061582
\begin{itemdescr}
16071583
\pnum
1608-
\requires
1609-
\tcode{tbl} either 0 or an array of at least
1610-
\tcode{table_size}
1611-
elements.
1584+
\expects
1585+
Either \tcode{tbl == nullptr} is \tcode{true} or \range{tbl}{tbl+table_size} is a valid range.
16121586

16131587
\pnum
16141588
\effects
@@ -2001,12 +1975,10 @@
20011975

20021976
\begin{itemdescr}
20031977
\pnum
2004-
\requires
2005-
\tcode{(from <= from_end \&\& to <= to_end)}
2006-
well-defined and
2007-
\tcode{true};
2008-
\tcode{state} initialized, if at the beginning of a sequence, or else equal to
2009-
the result of converting the preceding characters in the sequence.
1978+
\expects
1979+
\tcode{(from <= from_end \&\& to <= to_end)} is well-defined and \tcode{true};
1980+
\tcode{state} is initialized, if at the beginning of a sequence,
1981+
or else is equal to the result of converting the preceding characters in the sequence.
20101982

20111983
\pnum
20121984
\effects
@@ -2122,10 +2094,10 @@
21222094

21232095
\begin{itemdescr}
21242096
\pnum
2125-
\requires
2126-
\tcode{(to <= to_end)}
2127-
well-defined and \tcode{true}; state initialized, if at the beginning of a sequence,
2128-
or else equal to the result of converting the preceding characters in the
2097+
\expects
2098+
\tcode{(to <= to_end)} is well-defined and \tcode{true};
2099+
\tcode{state} is initialized, if at the beginning of a sequence,
2100+
or else is equal to the result of converting the preceding characters in the
21292101
sequence.
21302102

21312103
\pnum
@@ -2202,16 +2174,14 @@
22022174

22032175
\begin{itemdescr}
22042176
\pnum
2205-
\requires
2206-
\tcode{(from <= from_end)}
2207-
well-defined and
2208-
\tcode{true};
2209-
\tcode{state} initialized, if at the beginning of a sequence, or else equal to
2210-
the result of converting the preceding characters in the sequence.
2177+
\expects
2178+
\tcode{(from <= from_end)} is well-defined and \tcode{true};
2179+
\tcode{state} is initialized, if at the beginning of a sequence,
2180+
or else is equal to the result of converting the preceding characters in the sequence.
22112181

22122182
\pnum
22132183
\effects
2214-
The effect on the \tcode{state} argument is ``as if'' it called
2184+
The effect on the \tcode{state} argument is as if it called
22152185
\tcode{do_in(state, from, from_end, from, to, to+max, to)}
22162186
for \tcode{to} pointing to a buffer of at least \tcode{max} elements.
22172187

@@ -3249,7 +3219,7 @@
32493219
\begin{itemdescr}
32503220
\pnum
32513221
\returns
3252-
A basic_string<char> \tcode{vec} used as a vector of integer values,
3222+
A \tcode{string} \tcode{vec} used as a vector of integer values,
32533223
in which each element
32543224
\tcode{vec[i]}
32553225
represents the number of digits\footnote{Thus, the string
@@ -3677,7 +3647,8 @@
36773647

36783648
\begin{itemdescr}
36793649
\pnum
3680-
\requires \range{fmt}{fmtend} shall be a valid range.
3650+
\expects
3651+
\range{fmt}{fmtend} is a valid range.
36813652

36823653
\pnum
36833654
\effects
@@ -3882,8 +3853,8 @@
38823853

38833854
\begin{itemdescr}
38843855
\pnum
3885-
\requires
3886-
\tcode{t} shall point to an object.
3856+
\expects
3857+
\tcode{t} points to an object.
38873858

38883859
\pnum
38893860
\effects
@@ -4861,7 +4832,7 @@
48614832

48624833
explicit messages(size_t refs = 0);
48634834

4864-
catalog open(const basic_string<char>& fn, const locale&) const;
4835+
catalog open(const string& fn, const locale&) const;
48654836
string_type get(catalog c, int set, int msgid,
48664837
const string_type& dfault) const;
48674838
void close(catalog c) const;
@@ -4870,7 +4841,7 @@
48704841

48714842
protected:
48724843
~messages();
4873-
virtual catalog do_open(const basic_string<char>&, const locale&) const;
4844+
virtual catalog do_open(const string&, const locale&) const;
48744845
virtual string_type do_get(catalog, int set, int msgid,
48754846
const string_type& dfault) const;
48764847
virtual void do_close(catalog) const;
@@ -4892,7 +4863,7 @@
48924863

48934864
\indexlibrarymember{messages}{open}%
48944865
\begin{itemdecl}
4895-
catalog open(const basic_string<char>& name, const locale& loc) const;
4866+
catalog open(const string& name, const locale& loc) const;
48964867
\end{itemdecl}
48974868

48984869
\begin{itemdescr}
@@ -4928,7 +4899,7 @@
49284899

49294900
\indexlibrarymember{messages}{do_open}%
49304901
\begin{itemdecl}
4931-
catalog do_open(const basic_string<char>& name, const locale& loc) const;
4902+
catalog do_open(const string& name, const locale& loc) const;
49324903
\end{itemdecl}
49334904

49344905
\begin{itemdescr}
@@ -4959,8 +4930,8 @@
49594930

49604931
\begin{itemdescr}
49614932
\pnum
4962-
\requires
4963-
\tcode{cat} shall be a catalog obtained from
4933+
\expects
4934+
\tcode{cat} is a catalog obtained from
49644935
\tcode{open()}
49654936
and not yet closed.
49664937

@@ -4978,8 +4949,8 @@
49784949

49794950
\begin{itemdescr}
49804951
\pnum
4981-
\requires
4982-
\tcode{cat} shall be a catalog obtained from
4952+
\expects
4953+
\tcode{cat} is a catalog obtained from
49834954
\tcode{open()}
49844955
and not yet closed.
49854956

0 commit comments

Comments
 (0)