
13 Jun
2012
13 Jun
'12
4:50 a.m.
El 13/06/2012 1:08, Ion Gaztañaga escribió:
1) s has enough capacity, potentially a single allocation
std::string s; s.reserve(largest_path); //one allocation std::string ws; ws.reserve(largest_path); //one allocation
for( N times ) { calculate_unix_path(s, directory_name, filename[i]...);//no allocation ws = to_wide_string(s); //no allocation print_s(ws); }
Sorry, I meant: to_wide_string(ws, s); //no allocation