Tag: STL
&x[0] -for empty strings this has undefined behaviour (21.3.4) e.g. given f(const char* p, size_t n) { if (n == 0) return; ...whatever... } you mustn't call f(&x[0], x.size()); when x.empty() - just use f(x.data(), ...). -otherwise, as per x.data() but: for non-const x this yields a non-const char* pointer; you can overwrite string content