What happens when you attempt to compile and run the following code? #include #include #include #include using namespace std; templatestruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< v1(10); generate_n(v1.begin(), 10, Sequence(1)); random_shuffle(v1.rbegin(), v1.rend()); sort(v1.begin(), v1.end(), great()); for_each(v1.begin(), v1.end(), Out(cout));cout<
What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 1 2 3 end? #include #include #include #include using namespace std; templatestruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) {out< l; for( ; !cin.bad() ; ) { int i; cin>>i; l.push_back(i); } for_each(l.begin(), l.end(), Out(cout)); return 0;}Program will output:
What happens when you attempt to compile and run the following code? #include #include #include using namespace std; class B { int val; public:B(int v):val(v){} int getV() const {return val;} bool operator < (const B & v) const { return valstruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< v1(10); sort(t1, t1+5); sort(t2, t2+5); merge(t1,t1+5,t2,t2+5,v1.begin()); for_each(v1.begin(), v1.end(), Out(cout));cout<