Created on 2025-05-30.00:00:00 last changed 3 weeks 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]).
`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-06-05 15:52:42 | admin | set | messages: + msg14775 |
2025-05-30 00:00:00 | admin | create |