Open chris-stones opened 4 years ago
The create test uses a similar code, but passes the observer by reference.
return rx::observable<>::create<int>(
[&](const rx::subscriber<int>& s){
invoked++;
s.on_next(1);
s.on_next(2);
})
This doesnt compile either.
Im very confused by this all!
The rxcppv2_test
target, which includes this source DOES compile...
But when i try to build the single test for create, it does not compile..Same error as above.
Looking at the actual code for create(), it LOOKS like it should be used something like this.. ?
return rx::sources::create<int>(
[&](const rx::subscriber<int>& s){
invoked++;
s.on_next(1);
s.on_next(2);
})
In the sources
namespace, NOT obseravable<> struct.
Using the sources namespace instead of observable<> seems to fix this for me... Which leads me to belive that perhaps the documentation is hopelessly out of date?
But, then why would the create test not raise this as an issue ?
Is there something clever i need to do to make observable<>::create
Im affraid im having a little trouble understanding the code.. It is all very clever.
Not tried in other compilers.
But in GCC 10.2.0 (Manjaro GNU/Linux), the following code - offered in many learning resources does not compile.
Is this a bug in RxCPP, or GCC?
main.cpp
CMake
console
RxCPP version 9002d9bea0e6b90624672e90a409b56de5286fc6.