In this article on defining your own extensions to ::std::error_code
the author recommends this code:
namespace std
{
template <>
struct is_error_code_enum<http_error>
: public true_type {};
}
in order to enable conversions from your own error constants to the system error type.
Is this reasonable? It always makes me nervous to put things into the std
namespace. Is there a better way of accomplishing the goal? Failing all that, is there a part of the standard that says this is always OK to do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With