Boost makes std::error_category wrapper for boost::system::error_category. It proxies name() and message() calls. But we can't inject original std::error_category into this mapping. So even if we maintain our own mapping, but some code casts error via boost, it may create new wrappers indefinitely.
Error comparison may be unavailable (e.g. error == EOF) for underlying stream errors.
If we will map to single boost error.
Or if conversion is inconsistent (e.g. s1 -> b1, b1 -> s1', s1 != s1').
May store last read and write errors in stream instance (like errno), as there can only be one active read/write.
May need to check lifetimes during async read/write operation.
dynamic_cast
.Open questions:
std::error_code
andboost::system::error_code
conversion.s1 -> b1, b1 -> s1', s1' -> b1'
, ...).name()
andmessage()
calls. But we can't inject original std::error_category into this mapping. So even if we maintain our own mapping, but some code casts error via boost, it may create new wrappers indefinitely.error == EOF
) for underlying stream errors.s1 -> b1, b1 -> s1', s1 != s1'
).