ShooterIT commented on PR #768:
URL: 
https://github.com/apache/incubator-kvrocks/pull/768#issuecomment-1208824712

   To be honest, this is the first time to see this usage. I study your PR and 
https://abseil.io/docs/cpp/guides/status, i find it truly satisfies my 
requirement that i want to return status or value if ok when calling function, 
a bit like multi return value, such as
   ```
   StatusOr<Foo> result = Calculation();
   if (result.ok()) {
     result->DoSomethingCool();
   } else {
     LOG(ERROR) << result.status();
   }
   ```
   
   before you PR, our usage is like the following:
   ```
   MyType myvalue;
   Status s = Func(&myvalue);
   if (s.ok()) {
     DoThings(myvalue);
   } else {
     ErrorReport();
   }
   ```
   
   I think you may want to refactor these usages above, right?
   
   i am not a c++ language expert, i don't see this usage frequently, i think 
there are a few people accept quickly, so i am not sure we should merge this. 
Maybe i am lazy, and not want to learn new knowledge.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to