Title
§[const.wrap.class] "`operator decltype(auto)`" is ill-formed
Status
new
Section
[const.wrap.class]
Submitter
Jiang An

Created on 2025-11-07.00:00:00 last changed 1 week ago

Messages

Date: 2025-11-10.15:34:12

Proposed resolution:

This wording is relative to N5014.

  1. Modify [const.wrap.class], class template `constant_wrapper` synopsis, as indicated:

    […]
    template<cw-fixed-value X, class>
    struct constant_wrapper : cw-operators {
      static constexpr const auto & value = X.data;
    
      using type = constant_wrapper;
      using value_type = typename decltype(X)::type;
    
      […]
      constexpr operator decltype(autovalue)() const noexcept { return value; }
    };
    
Date: 2025-11-07.00:00:00

Following the approval of CWG 1670 in Kona 2025, the following declaration in class template `constant_wrapper`, [const.wrap.class], is ill-formed:

constexpr operator decltype(auto)() const noexcept { return value; }
History
Date User Action Args
2025-11-10 15:34:12adminsetmessages: + msg15610
2025-11-07 00:00:00admincreate