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

4486. integral-constant-like and constexpr-wrapper-like exposition-only concept duplication

Section: 23.7.2.1 [span.syn], 29.10.2 [simd.expos] Status: Ready Submitter: Jonathan Wakely Opened: 2025-12-12 Last modified: 2025-12-12

Priority: Not Prioritized

View all other issues in [span.syn].

View all issues with Ready status.

Discussion:

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.

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

Proposed resolution:

This wording is relative to N5014.

  1. Modify 16.3.3.2 [expos.only.entity] by moving the concept (unchanged) from 29.10.2 [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 23.7.2.1 [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 29.10.2 [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;