Title
integral-constant-like and constexpr-wrapper-like exposition-only concept duplication
Status
ready
Section
[span.syn][simd.expos]
Submitter
Jonathan Wakely

Created on 2025-12-12.00:00:00 last changed 2 weeks ago

Messages

Date: 2025-12-12.17:04:17

Proposed resolution:

This wording is relative to N5014.

  1. Modify [expos.only.entity] by moving the concept (unchanged) from [simd.expos]:

    
      template<class T, class U = T>
      using synth-three-way-result =                        // exposition only
        decltype(synth-three-way(declval<T&>(), declval<U&>()));
    
      template<class T>
        concept constexpr-wrapper-like =                  // exposition only
          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;
    }
    
  2. 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_const_t<decltype(T::value)>> &&
        constexpr-wrapper-like<T>;
        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;
    
  3. Modify [simd.expos] as indicated:

    template<class T>
      concept constexpr-wrapper-like =                    // exposition only
        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-12-15.00:00:00

[ 2025-12-12; LWG telecon; Status changed: New → Ready. ]

Date: 2025-12-12.00:00:00
Addresses US 151-242

NB comment:

We have two exposition-only concepts for similar things (integral-constant-like and constant-wrapper-like). The former can be expressed in terms of the latter.
Proposed change: Move constant-wrapper-like to the library introduction and update integral-constant-like to use it.

History
Date User Action Args
2025-12-12 17:04:17adminsetmessages: + msg15820
2025-12-12 17:04:17adminsetstatus: new -> ready
2025-12-12 09:26:12adminsetmessages: + msg15819
2025-12-12 00:00:00admincreate