|
1198 | 1198 | \begin{itemdescr}
|
1199 | 1199 | \pnum
|
1200 | 1200 | \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}. |
1204 | 1202 |
|
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. |
1210 | 1207 | \end{itemdescr}
|
1211 | 1208 |
|
1212 | 1209 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1218 | 1215 | \begin{itemdescr}
|
1219 | 1216 | \pnum
|
1220 | 1217 | \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}. |
1226 | 1219 |
|
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. |
1236 | 1228 | \end{itemdescr}
|
1237 | 1229 |
|
1238 | 1230 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1256 | 1248 | \tcode{basic_string}
|
1257 | 1249 | and determines the effective length \tcode{rlen} of the initial string
|
1258 | 1250 | 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. |
1261 | 1252 |
|
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()}. |
1272 | 1259 | \end{itemdescr}
|
1273 | 1260 |
|
1274 | 1261 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1314 | 1301 |
|
1315 | 1302 | \pnum
|
1316 | 1303 | \effects
|
1317 |
| -Constructs an object of class |
1318 |
| -\tcode{basic_string} |
| 1304 | +Constructs an object of class \tcode{basic_string} |
1319 | 1305 | 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}. |
1323 | 1307 |
|
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()}. |
1333 | 1314 | \end{itemdescr}
|
1334 | 1315 |
|
1335 | 1316 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1345 | 1326 |
|
1346 | 1327 | \pnum
|
1347 | 1328 | \effects
|
1348 |
| -Constructs an object of class |
1349 |
| -\tcode{basic_string} |
| 1329 | +Constructs an object of class \tcode{basic_string} |
1350 | 1330 | 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()}. |
1367 | 1340 | \end{itemdescr}
|
1368 | 1341 |
|
1369 | 1342 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1378 | 1351 |
|
1379 | 1352 | \pnum
|
1380 | 1353 | \effects
|
1381 |
| -Constructs an object of class |
1382 |
| -\tcode{basic_string} |
| 1354 | +Constructs an object of class \tcode{basic_string} |
1383 | 1355 | 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. |
1386 | 1357 |
|
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()}. |
1396 | 1364 | \end{itemdescr}
|
1397 | 1365 |
|
1398 | 1366 | \indexlibrary{\idxcode{basic_string}!constructor}%
|
|
1433 | 1401 |
|
1434 | 1402 | \begin{itemdescr}
|
1435 | 1403 | \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}. |
1440 | 1406 |
|
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. |
1452 | 1417 |
|
1453 | 1418 | \pnum
|
1454 | 1419 | \throws The second form throws nothing if \tcode{alloc == str.get_allocator()}.
|
|
1476 | 1441 | \end{itemdecl}
|
1477 | 1442 |
|
1478 | 1443 | \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 |
| - |
1494 | 1444 | \pnum
|
1495 | 1445 | \returns
|
1496 | 1446 | \tcode{*this}.
|
1497 | 1447 |
|
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()}. |
1507 | 1456 | \end{itemdescr}
|
1508 | 1457 |
|
1509 | 1458 | \indexlibrarymember{operator=}{basic_string}%
|
|
0 commit comments