What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
template
ostream & out;
Out(ostream & o): out(o){}
void operator() (const T & val ) { out<
int main() {
int t1[]={3,2,4,1,5};
int t2[]={5,6,8,2,1};
vector
sort(t1, t1+5);
sort(t2, t2+5);
set_union(t1,t1+5,t2,t2+5,v1.begin());
for_each(v1.begin(), v1.end(), Out
return 0;
}
Program outputs:
Arthur
17 days agoRanee
20 days agoKiera
21 days agoJillian
22 days agoLynna
26 days agoJillian
27 days ago