Created on 2021-09-30.00:00:00 last changed 47 months ago
Proposed resolution:
This wording is relative to N4892.
Modify [incrementable.traits] as indicated:
namespace std {
[…]
template<class T>
requires (!requires { typename T::difference_type; } &&
requires(const T& a, const T& b) { { a - b } -> integral; })
struct incrementable_traits<T> {
using difference_type = make_signed_t<decltype(declval<const T&>() - declval<const T&>())>;
};
[…]
}
[ 2022-01-29; Reflector poll ]
Set priority to 3 after reflector poll that failed to reach consensus. Some suggested NAD: "Implicit expression variations ([concepts.equality]/6) apply here."
The last specialization of incrementable_traits requires a - b to be well-formed, where the types of both operands are const lvalue reference of type T. However inside the struct, it uses decltype(declval<T>() - declval<T>()) to define the difference_type, that is, non-const rvalue reference of type T.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-01-29 22:17:14 | admin | set | messages: + msg12284 |
| 2021-10-03 17:55:36 | admin | set | messages: + msg12101 |
| 2021-09-30 00:00:00 | admin | create | |