@@ -142,11 +142,129 @@ struct <i>cw-operators</i> {
142142</ol >
143143</superseded >
144144
145- <note >2025-11-04 ; Zach provides improved wording</note >
145+ <note >2025-11-05 ; Zach provides improved wording</note >
146146
147147</discussion >
148148
149149<resolution >
150+ <p >
151+ This wording is relative to <paper num =" N5014" />.
152+ </p >
153+
154+ <ol >
155+
156+ <li ><p >Modify <sref ref =" [const.wrap.class]" />, class template <tt >constant_wrapper</tt > synopsis, as indicated:</p >
157+
158+ <blockquote class =" note" >
159+ <p >
160+ [<i >Drafting note:</i > The requires clause follows the form of `constant_wrapper`'s
161+ function call operator.]
162+ </p >
163+ </blockquote >
164+
165+ <blockquote >
166+ <pre >
167+ struct <i >cw-operators</i > { // <i >exposition only</i >
168+ [… ]
169+ // <i >pseudo-mutators</i >
170+ <del >template< <i >constexpr-param</i > T>
171+ constexpr auto operator++(this T) noexcept requires requires(T::value_type x) { ++x; }
172+ { return constant_wrapper< [] { auto c = T::value; return ++c; }()> {}; }
173+ template< <i >constexpr-param</i > T>
174+ constexpr auto operator++(this T, int) noexcept requires requires(T::value_type x) { x++; }
175+ { return constant_wrapper< [] { auto c = T::value; return c++; }()> {}; }
176+
177+ template< <i >constexpr-param</i > T>
178+ constexpr auto operator--(this T) noexcept requires requires(T::value_type x) { --x; }
179+ { return constant_wrapper< [] { auto c = T::value; return --c; }()> {}; }
180+ template< <i >constexpr-param</i > T>
181+ constexpr auto operator--(this T, int) noexcept requires requires(T::value_type x) { x--; }
182+ { return constant_wrapper< [] { auto c = T::value; return c--; }()> {}; }
183+
184+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
185+ constexpr auto operator+=(this T, R) noexcept requires requires(T::value_type x) { x += R::value; }
186+ { return constant_wrapper< [] { auto v = T::value; return v += R::value; }()> {}; }
187+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
188+ constexpr auto operator-=(this T, R) noexcept requires requires(T::value_type x) { x -= R::value; }
189+ { return constant_wrapper< [] { auto v = T::value; return v -= R::value; }()> {}; }
190+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
191+ constexpr auto operator*=(this T, R) noexcept requires requires(T::value_type x) { x *= R::value; }
192+ { return constant_wrapper< [] { auto v = T::value; return v *= R::value; }()> {}; }
193+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
194+ constexpr auto operator/=(this T, R) noexcept requires requires(T::value_type x) { x /= R::value; }
195+ { return constant_wrapper< [] { auto v = T::value; return v /= R::value; }()> {}; }
196+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
197+ constexpr auto operator%=(this T, R) noexcept requires requires(T::value_type x) { x %= R::value; }
198+ { return constant_wrapper< [] { auto v = T::value; return v %= R::value; }()> {}; }
199+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
200+ constexpr auto operator& =(this T, R) noexcept requires requires(T::value_type x) { x & = R::value; }
201+ { return constant_wrapper< [] { auto v = T::value; return v & = R::value; }()> {}; }
202+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
203+ constexpr auto operator|=(this T, R) noexcept requires requires(T::value_type x) { x |= R::value; }
204+ { return constant_wrapper< [] { auto v = T::value; return v |= R::value; }()> {}; }
205+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
206+ constexpr auto operator^=(this T, R) noexcept requires requires(T::value_type x) { x ^= R::value; }
207+ { return constant_wrapper< [] { auto v = T::value; return v ^= R::value; }()> {}; }
208+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
209+ constexpr auto operator<< =(this T, R) noexcept requires requires(T::value_type x) { x << = R::value; }
210+ { return constant_wrapper< [] { auto v = T::value; return v << = R::value; }()> {}; }
211+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
212+ constexpr auto operator>> =(this T, R) noexcept requires requires(T::value_type x) { x >> = R::value; }
213+ { return constant_wrapper< [] { auto v = T::value; return v >> = R::value; }()> {}; }</del >
214+ <ins >template< <i >constexpr-param</i > T>
215+ constexpr auto operator++(this T) noexcept -> constant_wrapper< ++Y> { return {}; }
216+ template< <i >constexpr-param</i > T>
217+ constexpr auto operator++(this T, int) noexcept -> constant_wrapper< Y++> { return {}; }
218+ template< <i >constexpr-param</i > T>
219+ constexpr auto operator--(this T) noexcept -> constant_wrapper< --Y> { return {}; }
220+ template< <i >constexpr-param</i > T>
221+ constexpr auto operator--(this T, int) noexcept -> constant_wrapper< Y--> { return {}; }
222+
223+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
224+ constexpr auto operator+=(T, R) noexcept -> constant_wrapper< (T::value += R::value)> { return {}; }
225+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
226+ constexpr auto operator-=(T, R) noexcept -> constant_wrapper< (T::value -= R::value)> { return {}; }
227+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
228+ constexpr auto operator*=(T, R) noexcept -> constant_wrapper< (T::value *= R::value)> { return {}; }
229+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
230+ constexpr auto operator/=(T, R) noexcept -> constant_wrapper< (T::value /= R::value)> { return {}; }
231+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
232+ constexpr auto operator%=(T, R) noexcept -> constant_wrapper< (T::value %= R::value)> { return {}; }
233+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
234+ constexpr auto operator& =(T, R) noexcept -> constant_wrapper< (T::value & = R::value)> { return {}; }
235+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
236+ constexpr auto operator|=(T, R) noexcept -> constant_wrapper< (T::value |= R::value)> { return {}; }
237+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
238+ constexpr auto operator^=(T, R) noexcept -> constant_wrapper< (T::value ^= R::value)> { return {}; }
239+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
240+ constexpr auto operator<< =(T, R) noexcept -> constant_wrapper< (T::value << = R::value)> { return {}; }
241+ template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
242+ constexpr auto operator>> =(T, R) noexcept -> constant_wrapper< (T::value >> = R::value)> { return {}; }</ins >
243+ };
244+ }
245+
246+ template< exposition_only::cw_fixed_value X, typename>
247+ struct constant_wrapper: exposition_only::cw_operators {
248+ static constexpr const auto & value = X.data;
249+ using type = constant_wrapper;
250+ using value_type = typename decltype(X)::type;
251+
252+ <del >template< <i >constexpr-param</i > R>
253+ constexpr auto operator=(R) const noexcept requires requires(value_type x) { x = R::value; }
254+ { return constant_wrapper< [] { auto v = value; return v = R::value; }()> {}; }</del >
255+ <ins >template< <i >constexpr-param</i > R>
256+ constexpr auto operator=(R) const noexcept -> constant_wrapper< X = R::value> { return {}; }</ins >
257+
258+ constexpr operator decltype(auto)() const noexcept { return value; }
259+ };
260+
261+ </pre >
262+ </blockquote >
263+
264+ </li >
265+
266+ </ol >
267+
150268</resolution >
151269
152270</issue >
0 commit comments