Skip to content

Commit b1cc60a

Browse files
burblebeetkoeppe
authored andcommitted
LWG3834 Missing constexpr for std::intmax_t math functions in <cinttypes>
1 parent 4406a7a commit b1cc60a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

source/iostreams.tex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18515,15 +18515,15 @@
1851518515
namespace std {
1851618516
using imaxdiv_t = @\seebelow@;
1851718517

18518-
intmax_t imaxabs(intmax_t j);
18519-
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
18518+
constexpr intmax_t imaxabs(intmax_t j);
18519+
constexpr imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
1852018520
intmax_t strtoimax(const char* nptr, char** endptr, int base);
1852118521
uintmax_t strtoumax(const char* nptr, char** endptr, int base);
1852218522
intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base);
1852318523
uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base);
1852418524

18525-
intmax_t abs(intmax_t); // optional, see below
18526-
imaxdiv_t div(intmax_t, intmax_t); // optional, see below
18525+
constexpr intmax_t abs(intmax_t); // optional, see below
18526+
constexpr imaxdiv_t div(intmax_t, intmax_t); // optional, see below
1852718527
}
1852818528

1852918529
#define PRId@\placeholdernc{N}@ @\seebelow@
@@ -18595,12 +18595,12 @@
1859518595
if and only if the type \tcode{intmax_t} designates an extended integer
1859618596
type\iref{basic.fundamental}, the following function signatures are added:
1859718597
\begin{codeblock}
18598-
intmax_t abs(intmax_t);
18599-
imaxdiv_t div(intmax_t, intmax_t);
18598+
constexpr intmax_t abs(intmax_t);
18599+
constexpr imaxdiv_t div(intmax_t, intmax_t);
1860018600
\end{codeblock}
1860118601
which shall have the same semantics as the function signatures
18602-
\tcode{intmax_t imaxabs(intmax_t)} and
18603-
\tcode{imaxdiv_t imaxdiv(intmax_t, intmax_t)}, respectively.
18602+
\tcode{constexpr intmax_t imaxabs(intmax_t)} and
18603+
\tcode{constexpr imaxdiv_t imaxdiv(intmax_t, intmax_t)}, respectively.
1860418604
\end{itemize}
1860518605

1860618606
\xrefc{7.8}

0 commit comments

Comments
 (0)