@@ -144,13 +144,14 @@ namespace STDEXEC
144144 _WITH_PRETTY_SENDER_<_Sender>,
145145 _WITH_ENVIRONMENT_ (_Env)...>;
146146
147- #if __cpp_lib_constexpr_exceptions \
148- >= 2025'02L // constexpr exception types, https://wg21.link/p3378
147+ #if __cpp_lib_constexpr_exceptions >= 2025'02L
149148
149+ // constexpr stdlib exception types, https://wg21.link/p3378
150150 using __exception = ::std::exception;
151151
152- #elif __cpp_constexpr >= 2024'11L // constexpr virtual functions
152+ #elif __cpp_constexpr >= 2019'07L
153153
154+ // constexpr virtual functions
154155 struct __exception
155156 {
156157 constexpr __exception () noexcept = default;
@@ -163,8 +164,9 @@ namespace STDEXEC
163164 }
164165 };
165166
166- #else // no constexpr virtual functions:
167+ #else
167168
169+ // no constexpr virtual functions
168170 struct __exception
169171 {
170172 constexpr __exception () noexcept = default;
@@ -176,23 +178,13 @@ namespace STDEXEC
176178 }
177179 };
178180
179- #endif // __cpp_lib_constexpr_exceptions >= 2025'02L
181+ #endif
180182
181- template <class _Derived >
182183 struct __compile_time_error : __exception
183- {
184- constexpr __compile_time_error () = default; // NOLINT (bugprone-crtp-constructor-accessibility)
185-
186- [[nodiscard]]
187- constexpr auto what () const noexcept -> char const *
188- {
189- return static_cast <_Derived const *>(this )->what ();
190- }
191- };
184+ { };
192185
193186 template <class _Data , class ... _What>
194- struct __sender_type_check_failure //
195- : __compile_time_error<__sender_type_check_failure<_Data, _What...>>
187+ struct __sender_type_check_failure : __compile_time_error
196188 {
197189 static_assert (std::is_nothrow_move_constructible_v<_Data>,
198190 " The data member of sender_type_check_failure must be nothrow move "
@@ -204,34 +196,24 @@ namespace STDEXEC
204196 : __data_(static_cast <_Data &&>(data))
205197 {}
206198
207- private:
208- friend struct __compile_time_error <__sender_type_check_failure>;
209-
210199 [[nodiscard]]
211- constexpr auto what () const noexcept -> char const *
200+ constexpr auto what () const noexcept -> char const * // NOLINT(modernize-use-override)
212201 {
213202 return " This sender is not well-formed. It does not meet the requirements of a sender type." ;
214203 }
215204
205+ // public so that __sender_type_check_failure is a structural type
216206 _Data __data_{};
217207 };
218208
219- struct dependent_sender_error : __compile_time_error<dependent_sender_error>
209+ struct dependent_sender_error : __compile_time_error
220210 {
221- constexpr explicit dependent_sender_error (char const *what) noexcept
222- : what_(what)
223- {}
224-
225- private:
226- friend struct __compile_time_error <dependent_sender_error>;
227-
228211 [[nodiscard]]
229- constexpr auto what () const noexcept -> char const *
212+ constexpr auto what () const noexcept -> char const * // NOLINT(modernize-use-override)
230213 {
231- return what_;
214+ return " This sender needs to know its execution environment before it can "
215+ " know how it will complete." ;
232216 }
233-
234- char const *what_;
235217 };
236218
237219 // A specialization of _ERROR_ to be used to report dependent sender. It inherits
@@ -257,11 +239,8 @@ namespace STDEXEC
257239 using __errors = _ERROR_;
258240 using __all = _ERROR_;
259241
260- constexpr _ERROR_ () noexcept
261- : dependent_sender_error{" This sender needs to know its execution environment before it can "
262- " know how it will "
263- " complete." }
264- {}
242+ constexpr _ERROR_ () = default;
243+ constexpr ~_ERROR_ () = default ;
265244
266245 STDEXEC_ATTRIBUTE (host, device) constexpr auto operator +() const -> _ERROR_;
267246
@@ -274,6 +253,8 @@ namespace STDEXEC
274253 constexpr auto operator ,(const _ERROR_<Other...> &) const -> _ERROR_<Other...>;
275254 };
276255
256+ static_assert (__structural<_ERROR_<dependent_sender_error>>);
257+
277258 // By making __dependent_sender_error_t an alias for _ERROR_<...>, we ensure that
278259 // it will get propagated correctly through various metafunctions.
279260 template <class _Sender >
0 commit comments