-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/result bind #101
Refactor/result bind #101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we do really need that change.
Doesn't look so easy for understanding and maintaining.
constexpr bool isError = std::is_base_of<ErrorBase, T>::value; | ||
|
||
/** | ||
* A struct that provides the result type conversion for bind operator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
* A struct that provides the result type conversion for bind operator. | |
* A struct that provides the result of type conversion for bind operator. |
* function outcome and former Result error type, and a method to convert | ||
* transformation function outcome to this type. | ||
*/ | ||
template <typename Transformed, typename ErrorType, typename = void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typename = void
- is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is needed for partial specialisation (please see below)
It is a standalone part of changes in #84, which was taken into a separate PR (this one) to alleviate that change that became rather big. |
Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
fa3bf42
to
4429ea9
Compare
…egration-tests Send batch transactions
Description of the Change
Now the bound transformation function may return one of:
Result
,Value
or any other unwrapped value that is treated like aValue
. Also, a rvalue-reference binding specialization is added. Two functions to convert aResult
'sError
orValue
toboost::optional
are added.Benefits
Hopefully allows to write a simpler code.
Possible Drawbacks
More code to maintain.
Usage Examples or Tests [optional]
Alternate Designs [optional]