Skip to content
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
26 changes: 24 additions & 2 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,29 @@
The old functionality can be achieved by calling \tcode{shrink_to_fit()} instead,
or the function call can be safely eliminated with no side effects.

\nodiffref
\change
Remove header \libnoheader{codecvt} and all its contents.
\rationale
The header has been deprecated for the previous three editions of this standard
and no longer implements the current Unicode standard, supporting only the
obsolete UCS-2 encoding.
Ongoing support is at implementer's discretion,
exercising freedoms granted by \ref{zombie.names}.
\effect
A valid \CppXXIII{} program \tcode{\#include}-ing the header or importing the
header unit may fail to compile. Code that uses any of the following names by
importing the standard library modules may fail to compile:
\begin{itemize}
\item \tcode{codecvt_mode},
\item \tcode{codecvt_utf16},
\item \tcode{codecvt_utf8},
\item \tcode{codecvt_utf8_utf16},
\item \tcode{consume_header},
\item \tcode{generate_header}, and
\item \tcode{little_endian}.
\end{itemize}

\rSec1[diff.cpp20]{\Cpp{} and ISO \CppXX{}}

\rSec2[diff.cpp20.general]{General}
Expand Down Expand Up @@ -2039,11 +2062,10 @@
\libheaderref{array},
\libheaderrefx{atomic}{atomics.syn},
\libheaderrefx{chrono}{time.syn},
\libdeprheaderref{codecvt},
\libheaderrefx{condition_variable}{condition.variable.syn},
\libheaderrefx{forward_list}{forward.list.syn},
\libheaderref{future},
\libheaderrefx{initializer_list}{initializer.list.syn},
\libheaderrefx{initiali\-zer_list}{initializer.list.syn},
\libheaderref{mutex},
\libheaderrefx{random}{rand.synopsis},
\libheaderref{ratio},
Expand Down
129 changes: 3 additions & 126 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2023,129 +2023,6 @@
Equivalent to: \tcode{return visit(std::forward<Visitor>(vis), arg.value);}
\end{itemdescr}

\rSec1[depr.locale.stdcvt]{Deprecated standard code conversion facets}

\rSec2[depr.locale.stdcvt.general]{General}

\pnum
The header \libheaderdef{codecvt} provides
code conversion facets for various character encodings.

\rSec2[depr.codecvt.syn]{Header \tcode{<codecvt>} synopsis}

\indexlibraryglobal{codecvt_mode}%
\indexlibraryglobal{codecvt_utf8}%
\indexlibraryglobal{codecvt_utf16}%
\indexlibraryglobal{codecvt_utf8_utf16}%
\begin{codeblock}
namespace std {
enum codecvt_mode {
consume_header = 4,
generate_header = 2,
little_endian = 1
};

template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf8 : public codecvt<Elem, char, mbstate_t> {
public:
explicit codecvt_utf8(size_t refs = 0);
~codecvt_utf8();
};

template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf16 : public codecvt<Elem, char, mbstate_t> {
public:
explicit codecvt_utf16(size_t refs = 0);
~codecvt_utf16();
};

template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
class codecvt_utf8_utf16 : public codecvt<Elem, char, mbstate_t> {
public:
explicit codecvt_utf8_utf16(size_t refs = 0);
~codecvt_utf8_utf16();
};
}
\end{codeblock}

\rSec2[depr.locale.stdcvt.req]{Requirements}

\pnum
For each of the three code conversion facets \tcode{codecvt_utf8},
\tcode{codecvt_utf16}, and \tcode{codecvt_utf8_utf16}:
\begin{itemize}
\item
\tcode{Elem} is one of
\keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t}.
\item
\tcode{Maxcode} is the largest value of \tcode{Elem}
converted to \tcode{\keyword{unsigned} \keyword{long}}
that the facet
will read or write without reporting a conversion error.
\item
If \tcode{(Mode \& consume_header)}, the facet shall consume an
initial header sequence, if present, when reading a multibyte sequence
to determine the endianness of the subsequent multibyte sequence to be read.
\item
If \tcode{(Mode \& generate_header)}, the facet shall generate an
initial header sequence when writing a multibyte sequence to advertise
the endianness of the subsequent multibyte sequence to be written.
\item
If \tcode{(Mode \& little_endian)}, the facet shall generate a
multibyte sequence in little-endian order,
as opposed to the default big-endian order.
\item
UCS-2 is the same encoding as UTF-16,
except that it encodes scalar values in the range
\ucode{0000}--\ucode{ffff} (Basic Multilingual Plane) only.
\end{itemize}

\pnum
\indextext{UTF-8}%
\indextext{UCS-2}%
\indextext{UTF-32}%
For the facet \tcode{codecvt_utf8}\indexlibraryglobal{codecvt_utf8}:
\begin{itemize}
\item
The facet shall convert between UTF-8 multibyte sequences
and UCS-2 or UTF-32 (depending on the size of \tcode{Elem}).
\item
Endianness shall not affect how multibyte sequences are read or written.
\item
The multibyte sequences may be written as either a text or a binary file.
\end{itemize}

\pnum
\indextext{UTF-16}%
\indextext{UCS-2}%
\indextext{UTF-32}%
For the facet \tcode{codecvt_utf16}\indexlibraryglobal{codecvt_utf16}:
\begin{itemize}
\item
The facet shall convert between UTF-16 multibyte sequences
and UCS-2 or UTF-32 (depending on the size of \tcode{Elem}).
\item
Multibyte sequences shall be read or written
according to the \tcode{Mode} flag, as set out above.
\item
The multibyte sequences may be written only as a binary file.
Attempting to write to a text file produces undefined behavior.
\end{itemize}

\pnum
\indextext{UTF-8}%
\indextext{UTF-16}%
For the facet \tcode{codecvt_utf8_utf16}\indexlibraryglobal{codecvt_utf8_utf16}:
\begin{itemize}
\item
The facet shall convert between UTF-8 multibyte sequences
and UTF-16 (one or two 16-bit codes) within the program.
\item
Endianness shall not affect how multibyte sequences are read or written.
\item
The multibyte sequences may be written as either a text or a binary file.
\end{itemize}

\rSec1[depr.conversions]{Deprecated convenience conversion interfaces}

\rSec2[depr.conversions.general]{General}
Expand Down Expand Up @@ -2174,12 +2051,12 @@
(like class template \tcode{codecvt}) to perform the conversions, without
affecting any streams or locales.
\begin{example}
If you want to use the code
conversion facet \tcode{codecvt_utf8} to output to \tcode{cout} a UTF-8
If you want to use a code
conversion facet, \tcode{codecvt_for_utf8}, to output to \tcode{cout} a UTF-8
multibyte sequence corresponding to a wide string, but you don't want to
alter the locale for \tcode{cout}, you can write something like:
\begin{codeblock}
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
std::wstring_convert<codecvt_for_utf8<wchar_t>> myconv;
std::string mbstring = myconv.to_bytes(L"Hello\n");
std::cout << mbstring;
\end{codeblock}
Expand Down
9 changes: 8 additions & 1 deletion source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,6 @@
\tcode{<bitset>} \\
\tcode{<charconv>} \\
\tcode{<chrono>} \\
\tcode{<codecvt>} \\
\tcode{<compare>} \\
\tcode{<complex>} \\
\tcode{<concepts>} \\
Expand Down Expand Up @@ -3028,18 +3027,25 @@
\item \indexlibraryzombie{bind2nd} \tcode{bind2nd},
\item \indexlibraryzombie{binder1st} \tcode{binder1st},
\item \indexlibraryzombie{binder2nd} \tcode{binder2nd},
\item \indexlibraryzombie{codecvt_mode} \tcode{codecvt_mode},
\item \indexlibraryzombie{codecvt_utf16} \tcode{codecvt_utf16},
\item \indexlibraryzombie{codecvt_utf8} \tcode{codecvt_utf8},
\item \indexlibraryzombie{codecvt_utf8_utf16} \tcode{codecvt_utf8_utf16},
\item \indexlibraryzombie{const_mem_fun1_ref_t} \tcode{const_mem_fun1_ref_t},
\item \indexlibraryzombie{const_mem_fun1_t} \tcode{const_mem_fun1_t},
\item \indexlibraryzombie{const_mem_fun_ref_t} \tcode{const_mem_fun_ref_t},
\item \indexlibraryzombie{const_mem_fun_t} \tcode{const_mem_fun_t},
\item \indexlibraryzombie{consume_header} \tcode{consume_header},
\item \indexlibraryzombie{declare_no_pointers} \tcode{declare_no_pointers},
\item \indexlibraryzombie{declare_reachable} \tcode{declare_reachable},
\item \indexlibraryzombie{generate_header} \tcode{generate_header},
\item \indexlibraryzombie{get_pointer_safety} \tcode{get_pointer_safety},
\item \indexlibraryzombie{get_temporary_buffer} \tcode{get_temporary_buffer},
\item \indexlibraryzombie{get_unexpected} \tcode{get_unexpected},
\item \indexlibraryzombie{gets} \tcode{gets},
\item \indexlibraryzombie{is_literal_type} \tcode{is_literal_type},
\item \indexlibraryzombie{is_literal_type_v} \tcode{is_literal_type_v},
\item \indexlibraryzombie{little_endian} \tcode{little_endian},
\item \indexlibraryzombie{mem_fun1_ref_t} \tcode{mem_fun1_ref_t},
\item \indexlibraryzombie{mem_fun1_t} \tcode{mem_fun1_t},
\item \indexlibraryzombie{mem_fun_ref_t} \tcode{mem_fun_ref_t},
Expand Down Expand Up @@ -3091,6 +3097,7 @@
The header names
\libnoheader{ccomplex},
\libnoheader{ciso646},
\libnoheader{codecvt},
\libnoheader{cstdalign},
\libnoheader{cstdbool}, and
\libnoheader{ctgmath}
Expand Down
6 changes: 6 additions & 0 deletions source/xrefdelta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
% P2864R2 Remove deprecated arithmetic conversions
\removedxref{depr.arith.conv.enum}

% P2871R3 Remove deprecated <codecvt> header
\removedxref{depr.codecvt.syn}
\removedxref{depr.locale.stdcvt}
\removedxref{depr.locale.stdcvt.general}
\removedxref{depr.locale.stdcvt.req}

% P2870R3 Remove deprecated typedef from `std::allocator`
\removedxref{depr.default.allocator}

Expand Down