Created on 2025-05-30.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N5008.
Modify [projected] as indicated:
namespace std { template<class I, class Proj> struct projected-impl { // exposition only struct type { // exposition only […] // models weakly_incrementable indirect_result_t<Proj&, I> operator*() const;// not defined}; }; […] }indirect_result_t<Proj&, I> operator*() const;-?- Mandates: This function is not odr-used ([basic.def.odr]).
[ 2025-10-20; Reflector poll. ]
Set priority to 3 after reflector poll.
"NAD, the standard is clear that it can't be used."
`std::projected::operator*` is only intentionally used for type calculation like `std::declval`. Currently, if one attempts to call it in a potentially evaluated expression, the program is ill-formed, no diagnostic required because the `operator*` is not defined.
It seems better to diagnose such misuse, as we are already diagnosing misuse of `std::declval` ([declval]/2). Implementation used to perform such misuse via `std::ranges::iter_move`, but libc++ and libstdc++ have already switched not to do this (see microsoft/STL#5555).| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-10-20 16:17:38 | admin | set | messages: + msg15284 |
| 2025-06-05 15:52:42 | admin | set | messages: + msg14775 |
| 2025-05-30 00:00:00 | admin | create | |