Commit bf20b80
committed
Add basic_static_string::available()
This returns max_size() - size(), i.e. the number of characters that can
still be inserted before the string reaches its capacity. Intended as a
shorthand for capacity-capped writes in combination with the
pos/count-taking overloads of append, assign, and insert:
str.append(sv, 0, str.available());
Addresses the ergonomic complaint in issue #81 without expanding the
overload set.
Closes issue #81.1 parent 9271183 commit bf20b80
2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2314 | 2314 | | |
2315 | 2315 | | |
2316 | 2316 | | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
2317 | 2334 | | |
2318 | 2335 | | |
2319 | 2336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
992 | 1015 | | |
993 | 1016 | | |
994 | 1017 | | |
| |||
0 commit comments