Created on 2022-11-27.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [cinttypes.syn], header <cinttypes> synopsis, as indicated:
[…] namespace std { using imaxdiv_t = see below; constexpr intmax_t imaxabs(intmax_t j); constexpr imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); intmax_t strtoimax(const char* nptr, char** endptr, int base); uintmax_t strtoumax(const char* nptr, char** endptr, int base); intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base); uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base); constexpr intmax_t abs(intmax_t); // optional, see below constexpr imaxdiv_t div(intmax_t, intmax_t); // optional, see below […] } […]-1- The contents and meaning of the header <cinttypes> are the same as the C standard library header <inttypes.h>, with the following changes:
(1.1) — The header <cinttypes> includes the header <cstdint> ([cstdint.syn]) instead of <stdint.h>, and
(1.2) — if and only if the type intmax_t designates an extended integer type ([basic.fundamental]), the following function signatures are added:
constexpr intmax_t abs(intmax_t); constexpr imaxdiv_t div(intmax_t, intmax_t);which shall have the same semantics as the function signatures constexpr intmax_t imaxabs(intmax_t) and constexpr imaxdiv_t imaxdiv(intmax_t, intmax_t), respectively.
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Voting → WP. ]
[ 2023-01-06; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
P0533R9 adds constexpr to math functions in <cmath> and <cstdlib>, which includes std::abs and std::div. This misses the overloads for std::intmax_t in <cinttypes>, as well as std::imaxabs and std::imaxdiv, which seems like an oversight.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 10:17:57 | admin | set | messages: + msg13364 |
2023-02-13 10:17:57 | admin | set | status: voting -> wp |
2023-02-06 15:33:48 | admin | set | status: ready -> voting |
2023-01-06 14:25:34 | admin | set | messages: + msg13167 |
2023-01-06 14:25:34 | admin | set | status: new -> ready |
2022-11-27 18:24:05 | admin | set | messages: + msg13120 |
2022-11-27 00:00:00 | admin | create |