Title
Make deref-move constexpr
Status
wp
Section
[specialized.algorithms.general]
Submitter
S.B. Tam

Created on 2025-11-05.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-11.10:48:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [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;
      }
    
Date: 2025-11-11.10:48:55

[ Kona 2025-11-08; Status changed: Immediate → WP. ]

Date: 2025-11-06.19:33:49

[ Kona 2025-11-06; approved by LWG. Status changed: New → Immediate. ]

Date: 2025-11-05.00:00:00

`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, both touching `std::uninitialized_move(_n)`, were adopted at the same meeting, and unfortunately none of them was aware of the other.

History
Date User Action Args
2025-11-11 10:48:55adminsetmessages: + msg15705
2025-11-11 10:48:55adminsetstatus: immediate -> wp
2025-11-06 19:33:49adminsetmessages: + msg15568
2025-11-06 19:33:49adminsetstatus: new -> immediate
2025-11-05 23:05:45adminsetmessages: + msg15535
2025-11-05 00:00:00admincreate