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