STL
STL copied to clipboard
`<algorithm>`: `ranges::inplace_merge` accidentally constructed `remove_cvref_t<iter_rvalue_reference_t <I>>`
This is basically a sibling of #4102.
https://github.com/microsoft/STL/blob/1c59a205787f4fdcd9c20decc8fa6dfa9096d394/stl/inc/algorithm#L7614-L7630
auto _Temp = _RANGES iter_move(_Mid) unexpectedly constructed remove_cvref_t<iter_reference_t<I>>.
Contrived testcase: https://godbolt.org/z/b7YqKPMej
It seems that we should use iter_value_t<_It> _Temp(_RANGES iter_move(_First));.
Agreed. As in https://github.com/microsoft/STL/issues/4102#issuecomment-1769421279 this also indicates missing test coverage.