martinzink commented on code in PR #1926:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1926#discussion_r2031192079
##########
utils/include/utils/expected.h:
##########
@@ -176,11 +177,26 @@ auto operator|(Expected&& object,
transform_error_wrapper<F> f) {
static_assert(valid_unexpected_type<transformed_error_type>, "transformError
expects a function returning a valid unexpected type");
using transformed_expected_type = nonstd::expected<value_type,
transformed_error_type>;
if (object.has_value()) {
- return transformed_expected_type{std::forward<Expected>(object)};
+ return transformed_expected_type{std::forward<Expected>(object).value()};
Review Comment:
Without that it fails to compile
```
/Users/mzink/Projects/minifi_zwei/utils/include/utils/expected.h:184:12:
error: no matching constructor for initialization of
'transformed_expected_type' (aka 'expected<unsigned long, std::string>')
184 | return transformed_expected_type{std::forward<Expected>(object)};
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mzink/Projects/minifi_zwei/extensions/standard-processors/processors/SplitRecord.cpp:54:7:
note: in instantiation of function template specialization
'org::apache::nifi::minifi::utils::detail::operator|<nonstd::expected_lite::expected<unsigned
long, std::error_code>, (lambda at
/Users/mzink/Projects/minifi_zwei/extensions/standard-processors/processors/SplitRecord.cpp:54:31)
&&>' requested here
54 | | utils::transformError([](std::error_code) -> std::string {
return std::string{"Records Per Split should be set to a number larger than
0"}; });
| ^
```
--
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]