|
162 | 162 | \indexlibrary{\idxcode{wsyncbuf}}%
|
163 | 163 | \indexlibrary{\idxcode{osyncstream}}%
|
164 | 164 | \indexlibrary{\idxcode{wosyncstream}}%
|
| 165 | +\indexlibrary{\idxcode{fpos}}% |
| 166 | +\indexlibrary{\idxcode{streampos}}% |
| 167 | +\indexlibrary{\idxcode{wstreampos}}% |
| 168 | +\indexlibrary{\idxcode{u16streampos}}% |
| 169 | +\indexlibrary{\idxcode{u32streampos}}% |
165 | 170 | \begin{codeblock}
|
166 | 171 | namespace std {
|
167 | 172 | template<class charT> class char_traits;
|
|
261 | 266 | using streampos = fpos<char_traits<char>::state_type>;
|
262 | 267 | using wstreampos = fpos<char_traits<wchar_t>::state_type>;
|
263 | 268 | using u8streampos = fpos<char_traits<char8_t>::state_type>;
|
| 269 | + using u16streampos = fpos<char_traits<char16_t>::state_type>; |
| 270 | + using u32streampos = fpos<char_traits<char32_t>::state_type>; |
264 | 271 | }
|
265 | 272 | \end{codeblock}
|
266 | 273 |
|
|
303 | 310 | class template specialization
|
304 | 311 | \tcode{basic_streambuf<charT, traits>}
|
305 | 312 | serves as a base class for class templates
|
306 |
| -\tcode{basic_stringbuf} |
| 313 | +\tcode{basic_stringbuf}, |
| 314 | +\tcode{basic_filebuf}, |
307 | 315 | and
|
308 |
| -\tcode{basic_filebuf}. |
| 316 | +\tcode{basic_syncbuf}. |
309 | 317 |
|
310 | 318 | \pnum
|
311 | 319 | The
|
|
321 | 329 | class template specialization
|
322 | 330 | \tcode{basic_ostream<charT, traits>}
|
323 | 331 | serves as a base class for class templates
|
324 |
| -\tcode{basic_ostringstream} |
| 332 | +\tcode{basic_ostringstream}, |
| 333 | +\tcode{basic_ofstream}, |
325 | 334 | and
|
326 |
| -\tcode{basic_ofstream}. |
| 335 | +\tcode{basic_osyncstream}. |
327 | 336 |
|
328 | 337 | \pnum
|
329 | 338 | The
|
|
334 | 343 | and
|
335 | 344 | \tcode{basic_fstream}.
|
336 | 345 |
|
| 346 | +\pnum |
| 347 | +\begin{note} |
| 348 | +For each of the class templates above, |
| 349 | +the program is ill-formed if |
| 350 | +\tcode{traits::char_type} |
| 351 | +is not the same type as |
| 352 | +\tcode{charT}\iref{char.traits}. |
| 353 | +\end{note} |
| 354 | + |
337 | 355 | \pnum
|
338 | 356 | Other \grammarterm{typedef-name}{s} define instances of
|
339 | 357 | class templates
|
|
348 | 366 | \tcode{fpos}
|
349 | 367 | are
|
350 | 368 | used for specifying file position information.
|
351 |
| - |
352 |
| -\pnum |
| 369 | +\begin{example} |
353 | 370 | The types
|
354 | 371 | \tcode{streampos}
|
355 | 372 | and
|
|
359 | 376 | and
|
360 | 377 | \tcode{wchar_t}
|
361 | 378 | respectively.
|
| 379 | +\end{example} |
362 | 380 |
|
363 | 381 | \pnum
|
364 | 382 | \begin{note}
|
|
368 | 386 | \tcode{char_traits<char>}.
|
369 | 387 | An implementation can avoid this circularity by substituting equivalent
|
370 | 388 | types.
|
371 |
| -One way to do this might be |
372 |
| -\begin{codeblock} |
373 |
| -template<class stateT> class fpos { @\commentellip@ }; // depends on nothing |
374 |
| -using _STATE = @\commentellip@ ; // implementation private declaration of \tcode{stateT} |
375 |
| - |
376 |
| -using streampos = fpos<_STATE>; |
377 |
| - |
378 |
| -template<> struct char_traits<char> { |
379 |
| - using pos_type = streampos; |
380 |
| -} |
381 |
| -\end{codeblock} |
382 | 389 | \end{note}
|
383 | 390 |
|
384 | 391 | \rSec1[iostream.objects]{Standard iostream objects}
|
|
0 commit comments