Re: Guidelines for use of Status and out parameters

2018-03-20 Thread Wes McKinney
Yes, the general guideline is to use Status (in C++ APIs) for exceptional behavior that is out of the control of the user of the C++ APIs. We have been trying to not use Status to make assertions that the developer has invoked the API correctly -- instead preconditions and other such checks should

Re: Guidelines for use of Status and out parameters

2018-03-20 Thread Uwe L. Korn
Hello, the general rule is: Use a Status as return value when you would throw an exception, otherwise return the value directly. In the case where a DCHECK is sufficient and no method is called that would return a Status, we should get rid of the Status return. For the AddField case it would be

Guidelines for use of Status and out parameters

2018-03-20 Thread Antoine Pitrou
Hello, I'm trying to understand when it is recommended to return a Status instance and use an out parameter for the result value, vs. when it is allowed to return the result value naturally. For instance we currently have the following methods on the Schema class: Status AddField(int i, const