This commit is contained in:
2025-09-17 21:57:05 +03:00
parent 1087e043a8
commit 83b7e0d924
2 changed files with 71 additions and 37 deletions

View File

@@ -167,11 +167,11 @@ static constexpr ErrT mcc_deduce_error(const DErrT& err, const ErrT& default_err
}
}
template <mcc_error_c ErrT, mcc_error_c DErrT>
template <typename ErrT, typename DErrT>
static constexpr std::error_code mcc_deduce_error_code(const DErrT& err, const ErrT& default_err)
requires(std::is_error_code_enum_v<ErrT> || std::derived_from<ErrT, std::error_code>)
requires(std::is_error_code_enum_v<ErrT> || std::same_as<ErrT, std::error_code>)
{
if constexpr (std::is_error_code_enum_v<DErrT>) {
if constexpr (std::is_error_code_enum_v<DErrT> || std::same_as<DErrT, std::error_code>) {
return err;
} else {
return default_err;