We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4678cf commit 8fe2f56Copy full SHA for 8fe2f56
1 file changed
include/rfl/OneOf.hpp
@@ -43,10 +43,12 @@ struct OneOf {
43
static rfl::Result<T> validate_impl(const T& _value,
44
std::vector<Error> _errors) {
45
return Head::validate(_value)
46
- .and_then([&](auto&& [[maybe_unused]] _result) -> rfl::Result<T> {
+ .and_then([&](auto&& _result) -> rfl::Result<T> {
47
if constexpr (sizeof...(Tail) == 0) {
48
if (_errors.size() == sizeof...(Cs)) {
49
return _value;
50
+ // The AI suggests return std::forward<decltype(_result)>(_result);
51
+ // is it correct in this context?
52
}
53
return error(make_error_message(_errors));
54
} else {
0 commit comments