I've created a custom rxcpp operator called validateImplementation
that should simply take a generic observable stream, make some validations on the SimpleInterface
and either continue or end the stream based on a certain condition (in my case the condition is whatsMyId
)
https://github.com/cipriancaba/rxcpp-examples/blob/master/src/SimpleOperators.cpp
template <class T> function<observable<T>(observable<T>)> SimpleOperators::validateImplementation(SimpleInterface component) {
return [&](observable<T> $str) {
return $str |
filter([&](const T item) {
if (component.whatsMyId() == "1") {
return true;
} else {
return false;
}
}
);
};
}
However, when trying to use the validateImplementation
method in main.cpp
, I get the following errors:
no matching member function for call to 'validateImplementation'
note: candidate template ignored: couldn't infer template argument 'T'
Can you help me understand what I'm doing wrong?