
7 Jul
2008
7 Jul
'08
3:46 a.m.
Sean Farrow wrote:
How does this assign overload work? Sound like wht I need.
Like the c'tor call, but using assign instead ;-): void from_vector(std::wstring& dst, const std::vector<wchar_t>& src) { dst.assign(src.begin(), src.end()); } This call is semantically equivalent to: dst.assign(wstring(src.begin(), src.end())); The c'tor template accepts any InputIterator with value type convertible to the value_type of the corresponding basic_string. [N.B.: If InputIterator is actually an integral type the standard requires that instead of a sequence constructor the constructor is invoked which creates astring of given size with given character value] Greetings from Bremen, Daniel Krügler