Skip to content

Commit 83e302d

Browse files
tkoeppezygoloid
authored andcommitted
[string.cons] Replace postcondition tables by ordinary Postcondition elements
1 parent 0abe2f3 commit 83e302d

File tree

1 file changed

+67
-118
lines changed

1 file changed

+67
-118
lines changed

source/strings.tex

Lines changed: 67 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,15 +1198,12 @@
11981198
\begin{itemdescr}
11991199
\pnum
12001200
\effects
1201-
Constructs an object of class
1202-
\tcode{basic_string}.
1203-
The postconditions of this function are indicated in Table~\ref{tab:strings.ctr.1}.
1201+
Constructs an object of class \tcode{basic_string}.
12041202

1205-
\begin{libefftabvalue}{\tcode{basic_string(const Allocator\&)} effects}{tab:strings.ctr.1}
1206-
\tcode{data()} & a non-null pointer that is copyable and can have 0 added to it \\ \rowsep
1207-
\tcode{size()} & 0 \\ \rowsep
1208-
\tcode{capacity()} & an unspecified value \\
1209-
\end{libefftabvalue}
1203+
\pnum
1204+
\postconditions
1205+
\tcode{data()} is a non-null pointer that is copyable and can have \tcode{0} added
1206+
to it, \tcode{size()} is \tcode{0}, and \tcode{capacity()} is an unspecified value.
12101207
\end{itemdescr}
12111208

12121209
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1218,21 +1215,16 @@
12181215
\begin{itemdescr}
12191216
\pnum
12201217
\effects
1221-
Constructs an object of class
1222-
\tcode{basic_string}
1223-
as indicated in Table~\ref{tab:strings.ctr.cpy}.
1224-
In the second form, \tcode{str}
1225-
is left in a valid state with an unspecified value.
1218+
Constructs an object of class \tcode{basic_string}.
12261219

1227-
\begin{libefftabvalue}
1228-
{\tcode{basic_string(const basic_string\&)} effects}
1229-
{tab:strings.ctr.cpy}
1230-
\tcode{data()} & points at the first element of an allocated
1231-
copy of the array whose first element is
1232-
pointed at by \tcode{str.data()} \\
1233-
\tcode{size()} & \tcode{str.size()} \\
1234-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1235-
\end{libefftabvalue}
1220+
\pnum
1221+
\postconditions
1222+
\tcode{data()} points at the first element of an allocated copy
1223+
of the array whose first element is pointed at by the original
1224+
value \tcode{str.data()}, \tcode{size()} is equal to the
1225+
original value of \tcode{str.size()}, and \tcode{capacity()} is a value
1226+
at least as large as \tcode{size()}.
1227+
In the second form, \tcode{str} is left in a valid state with an unspecified value.
12361228
\end{itemdescr}
12371229

12381230
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1256,19 +1248,14 @@
12561248
\tcode{basic_string}
12571249
and determines the effective length \tcode{rlen} of the initial string
12581250
value as \tcode{str.size() - pos} in the first form and
1259-
as the smaller of \tcode{str.size() - pos} and \tcode{n} in the second form,
1260-
as indicated in Table~\ref{tab:strings.ctr.2}.
1251+
as the smaller of \tcode{str.size() - pos} and \tcode{n} in the second form.
12611252

1262-
\begin{libefftabvalue}
1263-
{\tcode{basic_string(const basic_string\&, size_type, const Allocator\&)}\protect\mbox{ }and\protect\linebreak
1264-
\tcode{basic_string(const basic_string\&, size_type, size_type, const Allocator\&)} effects}
1265-
{tab:strings.ctr.2}
1266-
\tcode{data()} &
1267-
points at the first element of an allocated copy of \tcode{rlen} consecutive elements
1268-
of the string controlled by \tcode{str} beginning at position \tcode{pos} \\
1269-
\tcode{size()} & \tcode{rlen} \\
1270-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1271-
\end{libefftabvalue}
1253+
\pnum
1254+
\postconditions
1255+
\tcode{data()} points at the first element of an allocated copy of \tcode{rlen}
1256+
consecutive elements of the string controlled by \tcode{str} beginning at position
1257+
\tcode{pos}, \tcode{size()} is equal to \tcode{rlen}, and \tcode{capacity()} is a
1258+
value at least as large as \tcode{size()}.
12721259
\end{itemdescr}
12731260

12741261
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1314,22 +1301,16 @@
13141301

13151302
\pnum
13161303
\effects
1317-
Constructs an object of class
1318-
\tcode{basic_string}
1304+
Constructs an object of class \tcode{basic_string}
13191305
and determines its initial string value from the array of
1320-
\tcode{charT}
1321-
of length \tcode{n} whose first element is designated by \tcode{s},
1322-
as indicated in Table~\ref{tab:strings.ctr.3}.
1306+
\tcode{charT} of length \tcode{n} whose first element is designated by \tcode{s}.
13231307

1324-
\begin{libefftabvalue}
1325-
{\tcode{basic_string(const charT*, size_type, const Allocator\&)} effects}
1326-
{tab:strings.ctr.3}
1327-
\tcode{data()} &
1328-
points at the first element of an allocated copy of the array whose first element
1329-
is pointed at by \tcode{s} \\
1330-
\tcode{size()} & \tcode{n} \\
1331-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1332-
\end{libefftabvalue}
1308+
\pnum
1309+
\postconditions
1310+
\tcode{data()} points at the first element of an allocated copy
1311+
of the array whose first element is pointed at by \tcode{s},
1312+
\tcode{size()} is equal to \tcode{n}, and \tcode{capacity()} is
1313+
a value at least as large as \tcode{size()}.
13331314
\end{itemdescr}
13341315

13351316
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1345,25 +1326,17 @@
13451326

13461327
\pnum
13471328
\effects
1348-
Constructs an object of class
1349-
\tcode{basic_string}
1329+
Constructs an object of class \tcode{basic_string}
13501330
and determines its initial string value from the array of
1351-
\tcode{charT}
1352-
of length
1353-
\tcode{traits::length(s)}
1354-
whose first element is designated
1355-
by \tcode{s},
1356-
as indicated in Table~\ref{tab:strings.ctr.4}.
1357-
1358-
\begin{libefftabvalue}
1359-
{\tcode{basic_string(const charT*, const Allocator\&)} effects}
1360-
{tab:strings.ctr.4}
1361-
\tcode{data()} &
1362-
points at the first element of an allocated copy of the array whose first element
1363-
is pointed at by \tcode{s} \\
1364-
\tcode{size()} & \tcode{traits::length(s)} \\
1365-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1366-
\end{libefftabvalue}
1331+
\tcode{charT} of length \tcode{traits::length(s)}
1332+
whose first element is designated by \tcode{s}.
1333+
1334+
\pnum
1335+
\postconditions
1336+
\tcode{data()} points at the first element of an allocated copy
1337+
of the array whose first element is pointed at by \tcode{s},
1338+
\tcode{size()} is equal to \tcode{traits::length(s)}, and
1339+
\tcode{capacity()} is a value at least as large as \tcode{size()}.
13671340
\end{itemdescr}
13681341

13691342
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1378,21 +1351,16 @@
13781351

13791352
\pnum
13801353
\effects
1381-
Constructs an object of class
1382-
\tcode{basic_string}
1354+
Constructs an object of class \tcode{basic_string}
13831355
and determines its initial string value by repeating the char-like
1384-
object \tcode{c} for all \tcode{n} elements,
1385-
as indicated in Table~\ref{tab:strings.ctr.5}.
1356+
object \tcode{c} for all \tcode{n} elements.
13861357

1387-
\begin{libefftabvalue}
1388-
{\tcode{basic_string(size_t, charT, const Allocator\&)} effects}
1389-
{tab:strings.ctr.5}
1390-
\tcode{data()} &
1391-
points at the first element of an allocated array of \tcode{n} elements, each
1392-
storing the initial value \tcode{c} \\
1393-
\tcode{size()} & \tcode{n} \\
1394-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1395-
\end{libefftabvalue}
1358+
\pnum
1359+
\postconditions
1360+
\tcode{data()} points at the first element of an allocated array
1361+
of \tcode{n} elements, each storing the initial value \tcode{c},
1362+
\tcode{size()} is equal to \tcode{n}, and
1363+
\tcode{capacity()} is a value at least as large as \tcode{size()}.
13961364
\end{itemdescr}
13971365

13981366
\indexlibrary{\idxcode{basic_string}!constructor}%
@@ -1433,22 +1401,19 @@
14331401

14341402
\begin{itemdescr}
14351403
\pnum
1436-
\effects Constructs an object of class \tcode{basic_string} as indicated in
1437-
Table~\ref{tab:strings.ctr.6}. The stored allocator is constructed from
1438-
\tcode{alloc}. In the second form, \tcode{str} is left in a valid state with an
1439-
unspecified value.
1404+
\effects Constructs an object of class \tcode{basic_string}.
1405+
The stored allocator is constructed from \tcode{alloc}.
14401406

1441-
\begin{libefftabvalue}
1442-
{\tcode{basic_string(const basic_string\&, const Allocator\&)}\protect\linebreak and
1443-
\tcode{basic_string(basic_string\&\&, const Allocator\&)} effects}
1444-
{tab:strings.ctr.6}
1445-
\tcode{data()} &
1446-
points at the first element of an allocated copy of the array whose first
1447-
element is pointed at by the original value of \tcode{str.data()}. \\
1448-
\tcode{size()} & the original value of \tcode{str.size()} \\
1449-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1450-
\tcode{get_allocator()} & \tcode{alloc} \\
1451-
\end{libefftabvalue}
1407+
\pnum
1408+
\postconditions
1409+
\tcode{data()} points at the first element of an allocated copy
1410+
of the array whose first element is pointed at by the original
1411+
value of \tcode{str.data()}, \tcode{size()} is equal to the
1412+
original value of \tcode{str.size()}, \tcode{capacity()} is a value
1413+
at least as large as \tcode{size()}, and \tcode{get_allocator()} is
1414+
equal to \tcode{alloc}.
1415+
In the second form, \tcode{str} is left in a valid state with an
1416+
unspecified value.
14521417

14531418
\pnum
14541419
\throws The second form throws nothing if \tcode{alloc == str.get_allocator()}.
@@ -1476,34 +1441,18 @@
14761441
\end{itemdecl}
14771442

14781443
\begin{itemdescr}
1479-
\pnum
1480-
\effects
1481-
If
1482-
\tcode{*this}
1483-
and \tcode{str} are not the same object,
1484-
modifies
1485-
\tcode{*this}
1486-
as shown in Table~\ref{tab:strings.op=}.
1487-
1488-
\pnum
1489-
If
1490-
\tcode{*this}
1491-
and \tcode{str} are the same object,
1492-
the member has no effect.
1493-
14941444
\pnum
14951445
\returns
14961446
\tcode{*this}.
14971447

1498-
\begin{libefftabvalue}
1499-
{\tcode{operator=(const basic_string\&)} effects}
1500-
{tab:strings.op=}
1501-
\tcode{data()} &
1502-
points at the first element of an allocated copy of the array whose first
1503-
element is pointed at by \tcode{str.data()} \\
1504-
\tcode{size()} & \tcode{str.size()} \\
1505-
\tcode{capacity()} & a value at least as large as \tcode{size()} \\
1506-
\end{libefftabvalue}
1448+
\pnum
1449+
\postconditions
1450+
If \tcode{*this} and \tcode{str} are the same object, the member has no effect.
1451+
Otherwise,
1452+
\tcode{data()} points at the first element of an allocated copy
1453+
of the array whose first element is pointed at by \tcode{str.data()},
1454+
\tcode{size()} is equal to \tcode{str.size()}, and
1455+
\tcode{capacity()} is a value at least as large as \tcode{size()}.
15071456
\end{itemdescr}
15081457

15091458
\indexlibrarymember{operator=}{basic_string}%

0 commit comments

Comments
 (0)