Skip to content

Commit 801fb0b

Browse files
jensmaurertkoeppe
authored andcommitted
[conv.rank] Move from [conv] to [basic.types] (#1802)
1 parent ff65cec commit 801fb0b

File tree

2 files changed

+56
-55
lines changed

2 files changed

+56
-55
lines changed

source/basic.tex

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,6 +4155,62 @@
41554155
\end{example}%
41564156
\indextext{type|)}
41574157

4158+
\rSec2[conv.rank]{Integer conversion rank}%
4159+
\indextext{conversion!integer rank}
4160+
4161+
\pnum
4162+
Every integer type has an \term{integer conversion rank} defined as follows:
4163+
4164+
\begin{itemize}
4165+
\item No two signed integer types other than \tcode{char} and \tcode{signed
4166+
char} (if \tcode{char} is signed) shall have the same rank, even if they have
4167+
the same representation.
4168+
4169+
\item The rank of a signed integer type shall be greater than the rank
4170+
of any signed integer type with a smaller size.
4171+
4172+
\item The rank of \tcode{long long int} shall be greater
4173+
than the rank of \tcode{long int}, which shall be greater than
4174+
the rank of \tcode{int}, which shall be greater than the rank of
4175+
\tcode{short int}, which shall be greater than the rank of
4176+
\tcode{signed char}.
4177+
4178+
\item The rank of any unsigned integer type shall equal the rank of the
4179+
corresponding signed integer type.
4180+
4181+
\item The rank of any standard integer type shall be greater than the
4182+
rank of any extended integer type with the same size.
4183+
4184+
\item The rank of \tcode{char} shall equal the rank of \tcode{signed char}
4185+
and \tcode{unsigned char}.
4186+
4187+
\item The rank of \tcode{bool} shall be less than the rank of all other
4188+
standard integer types.
4189+
4190+
\indextext{type!\idxcode{wchar_t}}%
4191+
\indextext{type!\idxcode{char16_t}}%
4192+
\indextext{type!\idxcode{char32_t}}%
4193+
\item The ranks of \tcode{char16_t}, \tcode{char32_t}, and
4194+
\tcode{wchar_t} shall equal the ranks of their underlying
4195+
types\iref{basic.fundamental}.
4196+
4197+
\item The rank of any extended signed integer type relative to another
4198+
extended signed integer type with the same size is \impldef{rank of extended signed
4199+
integer type}, but still subject to the other rules for determining the integer
4200+
conversion rank.
4201+
4202+
\item For all integer types \tcode{T1}, \tcode{T2}, and \tcode{T3}, if
4203+
\tcode{T1} has greater rank than \tcode{T2} and \tcode{T2} has greater
4204+
rank than \tcode{T3}, then \tcode{T1} shall have greater rank than
4205+
\tcode{T3}.
4206+
\end{itemize}
4207+
4208+
\begin{note}
4209+
The integer conversion rank is used in the definition of the integral
4210+
promotions\iref{conv.prom} and the usual arithmetic
4211+
conversions\iref{expr.prop}.
4212+
\end{note}%
4213+
41584214
\rSec1[basic.exec]{Program execution}
41594215

41604216
\rSec2[intro.execution]{Sequential execution}

source/conversions.tex

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -608,59 +608,4 @@
608608
\tcode{std::nullptr_t} can be converted to a prvalue of type
609609
\tcode{bool}; the resulting value is \tcode{false}.
610610

611-
\rSec1[conv.rank]{Integer conversion rank}%
612-
\indextext{conversion!integer rank}
613-
614-
\pnum
615-
Every integer type has an \term{integer conversion rank} defined as follows:
616-
617-
\begin{itemize}
618-
\item No two signed integer types other than \tcode{char} and \tcode{signed
619-
char} (if \tcode{char} is signed) shall have the same rank, even if they have
620-
the same representation.
621-
622-
\item The rank of a signed integer type shall be greater than the rank
623-
of any signed integer type with a smaller size.
624-
625-
\item The rank of \tcode{long long int} shall be greater
626-
than the rank of \tcode{long int}, which shall be greater than
627-
the rank of \tcode{int}, which shall be greater than the rank of
628-
\tcode{short int}, which shall be greater than the rank of
629-
\tcode{signed char}.
630-
631-
\item The rank of any unsigned integer type shall equal the rank of the
632-
corresponding signed integer type.
633-
634-
\item The rank of any standard integer type shall be greater than the
635-
rank of any extended integer type with the same size.
636-
637-
\item The rank of \tcode{char} shall equal the rank of \tcode{signed char}
638-
and \tcode{unsigned char}.
639-
640-
\item The rank of \tcode{bool} shall be less than the rank of all other
641-
standard integer types.
642-
643-
\indextext{type!\idxcode{wchar_t}}%
644-
\indextext{type!\idxcode{char16_t}}%
645-
\indextext{type!\idxcode{char32_t}}%
646-
\item The ranks of \tcode{char16_t}, \tcode{char32_t}, and
647-
\tcode{wchar_t} shall equal the ranks of their underlying
648-
types\iref{basic.fundamental}.
649-
650-
\item The rank of any extended signed integer type relative to another
651-
extended signed integer type with the same size is \impldef{rank of extended signed
652-
integer type}, but still subject to the other rules for determining the integer
653-
conversion rank.
654-
655-
\item For all integer types \tcode{T1}, \tcode{T2}, and \tcode{T3}, if
656-
\tcode{T1} has greater rank than \tcode{T2} and \tcode{T2} has greater
657-
rank than \tcode{T3}, then \tcode{T1} shall have greater rank than
658-
\tcode{T3}.
659-
\end{itemize}
660-
661-
\begin{note}
662-
The integer conversion rank is used in the definition of the integral
663-
promotions\iref{conv.prom} and the usual arithmetic
664-
conversions\iref{expr.prop}.
665-
\end{note}%
666611
\indextext{conversion!standard|)}

0 commit comments

Comments
 (0)