Two things a caller would expect from dross::error are not available.
No operator== between two errors
include/dross/type/error.h declares a hand-written operator<=>(const error&). Under C++20 rules a user-declared three-way comparison synthesises the relational operators but not operator==, and none is declared, so a == b does not compile for two error values. The equality operators that do exist take an enum or a category, not another error.
The test added for the type works around this by comparing through <=> instead.
std::errc is rejected
The error_enum_type concept requires std::is_error_code_enum_v<E>. std::errc is an error condition enum: is_error_condition_enum_v<std::errc> is true and is_error_code_enum_v<std::errc> is false. So the templated constructor does not accept std::errc, which is the enumeration a caller reaches for first.
std::io_errc works, because it is an error code enum, but it covers one narrow domain.
Note
Accepting std::errc means either widening the concept to admit condition enums (and deciding what code() should then return) or providing a separate constructor. Both change the contract, so this needs a decision rather than a patch.
Two things a caller would expect from
dross::errorare not available.No
operator==between two errorsinclude/dross/type/error.hdeclares a hand-writtenoperator<=>(const error&). Under C++20 rules a user-declared three-way comparison synthesises the relational operators but notoperator==, and none is declared, soa == bdoes not compile for twoerrorvalues. The equality operators that do exist take an enum or a category, not anothererror.The test added for the type works around this by comparing through
<=>instead.std::errcis rejectedThe
error_enum_typeconcept requiresstd::is_error_code_enum_v<E>.std::errcis an error condition enum:is_error_condition_enum_v<std::errc>is true andis_error_code_enum_v<std::errc>is false. So the templated constructor does not acceptstd::errc, which is the enumeration a caller reaches for first.std::io_errcworks, because it is an error code enum, but it covers one narrow domain.Note
Accepting
std::errcmeans either widening the concept to admit condition enums (and deciding whatcode()should then return) or providing a separate constructor. Both change the contract, so this needs a decision rather than a patch.