Title
integral-constant-like needs more `remove_cvref_t`
Status
wp
Section
[span.syn]
Submitter
Jonathan Wakely

Created on 2025-09-05.00:00:00 last changed 5 days ago

Messages

Date: 2025-11-11.10:48:16

Proposed resolution:

This wording is relative to N5014.

  1. Modify [span.syn] as indicated:

    template<class T>
        concept integral-constant-like =                    // exposition only
          is_integral_v<remove_cvref_t<decltype(T::value)>> &&
          !is_same_v<bool, remove_cvrefconst_t<decltype(T::value)>> &&
          convertible_to<T, decltype(T::value)> &&
          equality_comparable_with<T, decltype(T::value)> &&
          bool_constant<T() == T::value>::value &&
          bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value;
    
Date: 2025-11-11.10:48:16

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

Date: 2025-10-15.00:00:00

[ 2025-10-17; Reflector poll. ]

Set status to Tentatively Ready after eight votes in favour during reflector poll.

Date: 2025-09-07.15:44:55

P2781R9 tweaked the definition of integral-constant-like to work with `constant_wrapper`, like so:

template<class T>
    concept integral-constant-like =                    // exposition only
      is_integral_v<remove_cvref_t<decltype(T::value)>> &&
      !is_same_v<bool, remove_const_t<decltype(T::value)>> &&
      convertible_to<T, decltype(T::value)> &&
      equality_comparable_with<T, decltype(T::value)> &&
      bool_constant<T() == T::value>::value &&
      bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value;

This was done so that cw<5> models the concept, but it needs an additional tweak so that cw<true> does not model it.

History
Date User Action Args
2025-11-11 10:48:16adminsetmessages: + msg15642
2025-11-11 10:48:16adminsetstatus: voting -> wp
2025-10-30 17:45:31adminsetstatus: ready -> voting
2025-10-17 14:12:23adminsetmessages: + msg15221
2025-10-17 14:12:23adminsetstatus: new -> ready
2025-09-05 17:57:33adminsetmessages: + msg15016
2025-09-05 00:00:00admincreate