mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Fix client.cc code, since res.error() without operator overloading… (#921)
* Fix client.cc code, since res.error() without operator overloading causing error in Xcode * Add unit test to check new error to string with operator overloading * Add inline as requested in code review comment
This commit is contained in:
parent
c58b00580e
commit
2a70c45697
2 changed files with 24 additions and 0 deletions
|
@ -804,6 +804,12 @@ enum class Error {
|
|||
Compression,
|
||||
};
|
||||
|
||||
inline std::ostream& operator << (std::ostream& os, const Error& obj)
|
||||
{
|
||||
os << static_cast<std::underlying_type<Error>::type>(obj);
|
||||
return os;
|
||||
}
|
||||
|
||||
class Result {
|
||||
public:
|
||||
Result(std::unique_ptr<Response> &&res, Error err,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue