validateImplementation
というカスタムrxcpp演算子を作成しました。これは一般的な観測可能なストリームを取得し、SimpleInterface
でいくつかのバリデーションを行い、特定の条件rxcppカスタム演算子でジェネリックを正しく推測する方法
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;
}
}
);
};
}
しかし、(私の場合には条件がwhatsMyId
です)main.cpp
でvalidateImplementation
メソッドを使用しようとすると、私は次のエラーを取得:
no matching member function for call to 'validateImplementation'
note: candidate template ignored: couldn't infer template argument 'T'
あなたは私が私が間違ってやっているのか理解に役立つことはできますか?
[mcve]をあなたの質問自体に(編集で)投稿してください。 –