Dear all,
I tried to concatenate a vector<string> into one string by using copy
algorithm however my code did not even compile. However I could not
understand why I can not even compile it.
Say,
string str("C++ ");
vector<string> strings(10, str);
string s;
copy(strings.begin(),strings.end(),back_inserter(s));
back_inserter can be used on a string because it is ok to use
push_back on string class. To use back_inserter, the container should
sup****t push_back and strings are also containers with push_back
member function, right?
But I get compile errors. I accomplished that later with ac***ulate
however but wondered the reason of the above problem.
Rgds,


|