Valid CPP Dumps shared by EduDump.com for Helping Passing CPP Exam! EduDump.com now offer the newest CPP exam dumps, the EduDump.com CPP exam questions have been updated and answers have been corrected get the newest EduDump.com CPP dumps with Test Engine here:
What happens when you attempt to compile and run the following code? #include <vector> #include <set> #include <iostream> #include <algorithm> using namespace std; template<class T>struct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out<<val<<" "; } }; template <typename T> struct Sequence { T start; T step; Sequence(T start, T step):start(start), step(step){} T operator()() { T v = start; start+=step; return v; } }; bool Less(float a, float b) { return int(a)<int(b);} int main() { float t[]={2.28, 1.66, 1.32, 3.94, 3.64, 2.3, 2.98, 1.96, 2.62, 1.13}; vector<float> v1; v1.assign(t, t+10); stable_sort(v1.begin(), v1.end(), Less); for_each(v1.begin(), v1.end(), Out<float>(cout));cout<<endl; return 0; } Program outputs: