Created on 2026-06-02.00:00:00 last changed 1 week ago
Proposed resolution:
This wording is relative to N5046.
Modify [numeric.sat.cast] as indicated:
template<class R, class T> constexpr R saturating_cast(T x) noexcept;-1- Constraints: `R` and `T` are signed or unsigned integer types ([basic.fundamental]).
-2- Returns: If `x` is representable as a value of type `R`, `x`; otherwise, either the largest or smallest representable value of type `R`, whichever is closer to the value of `x`. -?- Remarks: An invocation may explicitly specify an argument for the template parameter `R`.
Currently, [algorithms.requirements]/15 allows implementations to reject explicitly specifying template arguments for algorithms. Unfortunately, `std::saturating_cast` is also an algorithm as it is specifying in the "Algorithms library" chapter, and its first template argument must be explicitly specified. Without being "explicitly stated otherwise", `std::saturating_cast` is effectively unusable.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-13 12:27:45 | admin | set | messages: + msg16433 |
| 2026-06-02 00:00:00 | admin | create | |