The wording in the standard regarding implicit move changed in c++23
see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2266r3.html
relevant part is:
a returned move-eligible id-expression is always an xvalue
this seems to break the popular but unwise 'unmove'
template<typename T>
auto unmove(T&& v) -> std::remove_reference_t<T>& { return v; }
Current implementations seem to agree: https://godbolt.org/z/3n39rGM7b
Is this breaking change intended, or can we expect a DR?
unmove
being used even once. And the fix is simple:std::remove_reference_t<T>& vv = v; return vv;
, so I'm not sure if it's worth the effort to fix. – Cusack