Skip to content

P1148R0 Cleaning up Clause 20 #2496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
\indexlibrary{\idxcode{wsyncbuf}}%
\indexlibrary{\idxcode{osyncstream}}%
\indexlibrary{\idxcode{wosyncstream}}%
\indexlibrary{\idxcode{fpos}}%
\indexlibrary{\idxcode{streampos}}%
\indexlibrary{\idxcode{wstreampos}}%
\indexlibrary{\idxcode{u16streampos}}%
\indexlibrary{\idxcode{u32streampos}}%
\begin{codeblock}
namespace std {
template<class charT> class char_traits;
Expand Down Expand Up @@ -261,6 +266,8 @@
using streampos = fpos<char_traits<char>::state_type>;
using wstreampos = fpos<char_traits<wchar_t>::state_type>;
using u8streampos = fpos<char_traits<char8_t>::state_type>;
using u16streampos = fpos<char_traits<char16_t>::state_type>;
using u32streampos = fpos<char_traits<char32_t>::state_type>;
}
\end{codeblock}

Expand Down Expand Up @@ -303,9 +310,10 @@
class template specialization
\tcode{basic_streambuf<charT, traits>}
serves as a base class for class templates
\tcode{basic_stringbuf}
\tcode{basic_stringbuf},
\tcode{basic_filebuf},
and
\tcode{basic_filebuf}.
\tcode{basic_syncbuf}.

\pnum
The
Expand All @@ -321,9 +329,10 @@
class template specialization
\tcode{basic_ostream<charT, traits>}
serves as a base class for class templates
\tcode{basic_ostringstream}
\tcode{basic_ostringstream},
\tcode{basic_ofstream},
and
\tcode{basic_ofstream}.
\tcode{basic_osyncstream}.

\pnum
The
Expand All @@ -334,6 +343,15 @@
and
\tcode{basic_fstream}.

\pnum
\begin{note}
For each of the class templates above,
the program is ill-formed if
\tcode{traits::char_type}
is not the same type as
\tcode{charT}\iref{char.traits}.
\end{note}

\pnum
Other \grammarterm{typedef-name}{s} define instances of
class templates
Expand All @@ -348,8 +366,7 @@
\tcode{fpos}
are
used for specifying file position information.

\pnum
\begin{example}
The types
\tcode{streampos}
and
Expand All @@ -359,6 +376,7 @@
and
\tcode{wchar_t}
respectively.
\end{example}

\pnum
\begin{note}
Expand All @@ -368,17 +386,6 @@
\tcode{char_traits<char>}.
An implementation can avoid this circularity by substituting equivalent
types.
One way to do this might be
\begin{codeblock}
template<class stateT> class fpos { @\commentellip@ }; // depends on nothing
using _STATE = @\commentellip@ ; // implementation private declaration of \tcode{stateT}

using streampos = fpos<_STATE>;

template<> struct char_traits<char> {
using pos_type = streampos;
}
\end{codeblock}
\end{note}

\rSec1[iostream.objects]{Standard iostream objects}
Expand Down
Loading