Why not just replace std::copy with memmove()?



void str2vec(std::vector<char>& v, const std::string& s)
{
v.resize( s.size()+1 );
//std::copy(s.begin(), s.end(), v.begin());...