Hey guys, I'm trying to create an observable from a functor and I get an error:
class ObserverWrapper
{
public:
void operator()(rxcpp::subscriber<int> s)
{
s.on_completed();
}
};
int main()
{
auto functor = ObserverWrapper();
auto ints = rxcpp::observable<>::create<int>(functor);
}
Is that something I'm allowed to do?
Also, I noticed that if I cast it as an std::function first, the error goes away:
int main()
{
auto functor = ObserverWrapper();
auto casted = static_cast<std::function<void(rxcpp::subscriber<int> s)>>(functor);
auto ints = rxcpp::observable<>::create<int>(casted);
}
Hey guys, I'm trying to create an observable from a functor and I get an error:
Is that something I'm allowed to do?
Also, I noticed that if I cast it as an
std::function
first, the error goes away:Is this a bug or expected behaviour?