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< struct Add { int operator()(int & a, int & b) { return a+b; } }; int main() { int t[]={1,2,3,4,5,6,7,8,9,10}; vector vector transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add())); for_each(v2.rbegin(), v2.rend(), Out return 0; } Program outputs:
Evette
12 days agoMelissa
13 days agoLore
4 days agoMiesha
18 days agoLeslie
23 days agoFletcher
2 days agoCecil
4 days agoFletcher
8 days agoYan
17 days agoIsaiah
29 days agoPatrick
1 months agoBeata
6 days agoShawnee
10 days agoDorian
26 days agoAzzie
1 months agoLatonia
2 months agoOlive
2 months agoLashonda
2 months ago