@@ -77,61 +77,61 @@ struct <i>cw-operators</i> {
7777 // <i >pseudo-mutators</i >
7878 template< <i >constexpr-param</i > T>
7979 constexpr auto operator++(this T) noexcept
80- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > ++x< ins > > ()</ ins > ; }
80+ requires requires(T::value_type x) { constant_wrapper< ++x> (); }
8181 { return constant_wrapper< [] { auto c = T::value; return ++c; }()> {}; }
8282 template< <i >constexpr-param</i > T>
8383 constexpr auto operator++(this T, int) noexcept
84- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x++< ins > > ()</ ins > ; }
84+ requires requires(T::value_type x) { constant_wrapper< x++> (); }
8585 { return constant_wrapper< [] { auto c = T::value; return c++; }()> {}; }
8686
8787 template< <i >constexpr-param</i > T>
8888 constexpr auto operator--(this T) noexcept
89- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > --x< ins > > ()</ ins > ; }
89+ requires requires(T::value_type x) { constant_wrapper< --x> (); }
9090 { return constant_wrapper< [] { auto c = T::value; return --c; }()> {}; }
9191 template< <i >constexpr-param</i > T>
9292 constexpr auto operator--(this T, int) noexcept
93- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x--< ins > > ()</ ins > ; }
93+ requires requires(T::value_type x) { constant_wrapper< x--> (); }
9494 { return constant_wrapper< [] { auto c = T::value; return c--; }()> {}; }
9595
9696 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
9797 constexpr auto operator+=(this T, R) noexcept
98- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x += R::value< ins > > ()</ ins > ; }
98+ requires requires(T::value_type x) { constant_wrapper< x += R::value> (); }
9999 { return constant_wrapper< [] { auto v = T::value; return v += R::value; }()> {}; }
100100 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
101101 constexpr auto operator-=(this T, R) noexcept
102- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x -= R::value< ins > > ()</ ins > ; }
102+ requires requires(T::value_type x) { constant_wrapper< x -= R::value> (); }
103103 { return constant_wrapper< [] { auto v = T::value; return v -= R::value; }()> {}; }
104104 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
105105 constexpr auto operator*=(this T, R) noexcept
106- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x *= R::value< ins > > ()</ ins > ; }
106+ requires requires(T::value_type x) { constant_wrapper< x *= R::value> (); }
107107 { return constant_wrapper< [] { auto v = T::value; return v *= R::value; }()> {}; }
108108 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
109109 constexpr auto operator/=(this T, R) noexcept
110- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x /= R::value< ins > > ()</ ins > ; }
110+ requires requires(T::value_type x) { constant_wrapper< x /= R::value> (); }
111111 { return constant_wrapper< [] { auto v = T::value; return v /= R::value; }()> {}; }
112112 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
113113 constexpr auto operator%=(this T, R) noexcept
114- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x %= R::value< ins > > ()</ ins > ; }
114+ requires requires(T::value_type x) { constant_wrapper< x %= R::value> (); }
115115 { return constant_wrapper< [] { auto v = T::value; return v %= R::value; }()> {}; }
116116 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
117117 constexpr auto operator& =(this T, R) noexcept
118- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x & = R::value< ins > > ()</ ins > ; }
118+ requires requires(T::value_type x) { constant_wrapper< x & = R::value> (); }
119119 { return constant_wrapper< [] { auto v = T::value; return v & = R::value; }()> {}; }
120120 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
121121 constexpr auto operator|=(this T, R) noexcept
122- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x |= R::value< ins > > ()</ ins > ; }
122+ requires requires(T::value_type x) { constant_wrapper< x |= R::value> (); }
123123 { return constant_wrapper< [] { auto v = T::value; return v |= R::value; }()> {}; }
124124 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
125125 constexpr auto operator^=(this T, R) noexcept
126- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x ^= R::value< ins > > ()</ ins > ; }
126+ requires requires(T::value_type x) { constant_wrapper< x ^= R::value> (); }
127127 { return constant_wrapper< [] { auto v = T::value; return v ^= R::value; }()> {}; }
128128 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
129129 constexpr auto operator<< =(this T, R) noexcept
130- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x << = R::value< ins > > ()</ ins > ; }
130+ requires requires(T::value_type x) { constant_wrapper< x << = R::value> (); }
131131 { return constant_wrapper< [] { auto v = T::value; return v << = R::value; }()> {}; }
132132 template< <i >constexpr-param</i > T, <i >constexpr-param</i > R>
133133 constexpr auto operator>> =(this T, R) noexcept
134- requires requires(T::value_type x) { < ins > constant_wrapper< </ ins > x >> = R::value< ins > > ()</ ins > ; }
134+ requires requires(T::value_type x) { constant_wrapper< x >> = R::value> (); }
135135 { return constant_wrapper< [] { auto v = T::value; return v >> = R::value; }()> {}; }
136136};
137137</pre >
@@ -142,7 +142,79 @@ 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+ template< <i >constexpr-param</i > T>
166+ constexpr auto operator++(this T) noexcept -> constant_wrapper< ++Y> { return {}; }
167+ template< <i >constexpr-param</i > T>
168+ constexpr auto operator++(this T, int) noexcept -> constant_wrapper< Y++> { return {}; }
169+ template< <i >constexpr-param</i > T>
170+ constexpr auto operator--(this T) noexcept -> constant_wrapper< --Y> { return {}; }
171+ template< <i >constexpr-param</i > T>
172+ constexpr auto operator--(this T, int) noexcept -> constant_wrapper< Y--> { return {}; }
173+
174+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
175+ friend constexpr auto operator+=(U, V) noexcept -> constant_wrapper< (U::value += V::value)> { return {}; }
176+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
177+ friend constexpr auto operator-=(U, V) noexcept -> constant_wrapper< (U::value -= V::value)> { return {}; }
178+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
179+ friend constexpr auto operator*=(U, V) noexcept -> constant_wrapper< (U::value *= V::value)> { return {}; }
180+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
181+ friend constexpr auto operator/=(U, V) noexcept -> constant_wrapper< (U::value /= V::value)> { return {}; }
182+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
183+ friend constexpr auto operator%=(U, V) noexcept -> constant_wrapper< (U::value %= V::value)> { return {}; }
184+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
185+ friend constexpr auto operator& =(U, V) noexcept -> constant_wrapper< (U::value & = V::value)> { return {}; }
186+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
187+ friend constexpr auto operator|=(U, V) noexcept -> constant_wrapper< (U::value |= V::value)> { return {}; }
188+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
189+ friend constexpr auto operator^=(U, V) noexcept -> constant_wrapper< (U::value ^= V::value)> { return {}; }
190+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
191+ friend constexpr auto operator<< =(U, V) noexcept -> constant_wrapper< (U::value << = V::value)> { return {}; }
192+ template< <i >constexpr-param</i > U, <i >constexpr-param</i > V>
193+ friend constexpr auto operator>> =(U, V) noexcept -> constant_wrapper< (U::value >> = V::value)> { return {}; }
194+ };
195+ }
196+
197+ template< exposition_only::cw_fixed_value X, typename>
198+ struct constant_wrapper: exposition_only::cw_operators {
199+ static constexpr const auto & value = X.data;
200+ using type = constant_wrapper;
201+ using value_type = typename decltype(X)::type;
202+
203+ <del >template< <i >constexpr-param</i > R>
204+ constexpr auto operator=(R) const noexcept requires requires(value_type x) { x = R::value; }
205+ { return constant_wrapper< [] { auto v = value; return v = R::value; }()> {}; }</del >
206+ <ins >template< <i >constexpr-param</i > R>
207+ constexpr auto operator=(R) const noexcept -> constant_wrapper< X = R::value> { return {}; }</ins >
208+
209+ constexpr operator decltype(auto)() const noexcept { return value; }
210+ };
211+
212+ </pre >
213+ </blockquote >
214+
215+ </li >
216+
217+ </ol >
146218
147219</discussion >
148220
0 commit comments