int main() {
std::array< std::string,4 > a={{"Praseed", "Peter", "Sanjay","Raju"}};
auto values = rxcpp::observable<>::iterate(a).flat_map(
[] (std::string v ) {
std::array<std::string,3> salutation ={ { "Mr." , "Monsieur" , "Sri" }};
return rxcpp::observable<>::iterate(salutation);
},
[] ( std::string f , std::string s ) {
return s + " " +f;
});
values.subscribe( [] (std::string f) {
std::cout << f << std::endl; } , [] () {std::cout << "Hello World.." << std::endl;} );
}`
New commit output:
Mr. Praseed
Monsieur
Mr. Peter
Sri
Monsieur
Mr. Sanjay
Sri
Monsieur
Mr. Raju
Sri
Monsieur
Sri
Hello World..
Release version v4.1.1
Mr. Praseed
Monsieur Praseed
Mr. Peter
Sri Praseed
Monsieur Peter
Mr. Sanjay
Sri Peter
Monsieur Sanjay
Mr. Raju
Sri Sanjay
Monsieur Raju
Sri Raju
Hello World..
`#include "rxcpp/rx.hpp"
include "rxcpp/rx-test.hpp"
include
namespace rxu=rxcpp::util;
include
//#include
int main() { std::array< std::string,4 > a={{"Praseed", "Peter", "Sanjay","Raju"}}; auto values = rxcpp::observable<>::iterate(a).flat_map( [] (std::string v ) { std::array<std::string,3> salutation ={ { "Mr." , "Monsieur" , "Sri" }}; return rxcpp::observable<>::iterate(salutation); }, [] ( std::string f , std::string s ) { return s + " " +f; }); values.subscribe( [] (std::string f) { std::cout << f << std::endl; } , [] () {std::cout << "Hello World.." << std::endl;} ); }` New commit output:
Mr. Praseed Monsieur Mr. Peter Sri Monsieur Mr. Sanjay Sri Monsieur Mr. Raju Sri Monsieur Sri Hello World..
Release version v4.1.1 Mr. Praseed Monsieur Praseed Mr. Peter Sri Praseed Monsieur Peter Mr. Sanjay Sri Peter Monsieur Sanjay Mr. Raju Sri Sanjay Monsieur Raju Sri Raju Hello World..