3 ms·
string s = accumulate(vec.begin(), vec.end(), s); Is that legal C++? I would think that passes s to 'accumulate' before constructing it (http://www.gotw.ca/got
by Someone 13y ago
string s = accumulate(vec.begin(), vec.end(), s);
Is that legal C++? I would think that passes s to 'accumulate' before constructing it (http://www.gotw.ca/gotw/001.htm http://www.gotw.ca/gotw/001.htm). IMO, a correct way to do this would be:
string s; // calls string::string()
s = accumulate(vec.begin(), vec.end(), s);
or
string s = accumulate(vec.begin(), vec.end(), "");