ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.03k stars 390 forks source link

Pass Array to Onnext #507

Closed Zifkan closed 5 years ago

Zifkan commented 5 years ago

i have definition something like this:

rxcpp::subjects::subject<ray_hit[]> RayHitSubject = rxcpp::subjects::subject<ray_hit[]>();

and in implementation:

ray_hit rayhit[2]; RayHitSubject.get_subscriber().on_next(rayhit); and im getting error: Error C2664 'void rxcpp::observer<T,rxcpp::subjects::detail::multicast_observer<T>,void,void,void>::on_next(T (&&)) const': cannot convert argument 1 from 'ray_hit *' to 'T (&)' Im not familiar in c++ so how should i pass rayhit array as argument?

kirkshoop commented 5 years ago

in C++ you would either use std::vector<ray_hit> for dynamic arrays or std::array<2, ray_hit> for fixed-size arrays.