This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4452. Make deref-move constexpr

Section: 26.11.1 [specialized.algorithms.general] Status: New Submitter: S.B. Tam Opened: 2025-11-05 Last modified: 2025-11-06

Priority: Not Prioritized

View all other issues in [specialized.algorithms.general].

View all issues with New status.

Discussion:

std::uninitialized_move and std::uninitialized_move_n are constexpr and invoke deref-move, but deref-move is not constexpr. This looks like an obvious mistake.

Jiang An pointed out that P3508R0 and LWG 3918(i), both touching std::uninitialized_move(_n), were adopted at the same meeting, and unfortunately none of them was aware of the other.

Proposed resolution:

This wording is relative to N5014.

  1. Modify 26.11.1 [specialized.algorithms.general], as indicated:

    template<class I>
      constexpr decltype(auto) deref-move(I& it) {
        if constexpr (is_lvalue_reference_v<decltype(*it)>)
          return std::move(*it);
        else
          return *it;
      }