“& S [0]” aponta para caracteres contíguos em um std :: string?
Eu estou fazendo algum trabalho de manutenção e encontrei algo como o seguinte:
std::string s;
s.resize( strLength );
// strLength is a size_t with the length of a C string in it.
memcpy( &s[0], str, strLength );
Eu sei que usar & s [0] seria seguro se fosse um std :: vector, mas isso é um uso seguro de std :: string?