mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Fix #613
This commit is contained in:
parent
d7e63b4316
commit
510b4eaaae
1 changed files with 5 additions and 5 deletions
10
httplib.h
10
httplib.h
|
@ -697,13 +697,13 @@ enum Error {
|
|||
class Result {
|
||||
public:
|
||||
Result(std::shared_ptr<Response> res, Error err) : res_(res), err_(err) {}
|
||||
operator bool() { return res_ != nullptr; }
|
||||
operator bool() const { return res_ != nullptr; }
|
||||
bool operator==(std::nullptr_t) const { return res_ == nullptr; }
|
||||
bool operator!=(std::nullptr_t) const { return res_ != nullptr; }
|
||||
const Response &value() { return *res_; }
|
||||
const Response &operator*() { return *res_; }
|
||||
const Response *operator->() { return res_.get(); }
|
||||
Error error() { return err_; }
|
||||
const Response &value() const { return *res_; }
|
||||
const Response &operator*() const { return *res_; }
|
||||
const Response *operator->() const { return res_.get(); }
|
||||
Error error() const { return err_; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<Response> res_;
|
||||
|
|
Loading…
Reference in a new issue