Suppose we have a string
std::string str; // some value is assigned
What is the difference between str.empty() and str[0] =
str.empty()
str[0] =
empty() is not implemented as looking for the existence of a null character at position 0, its simply
bool empty() const { return size() == 0 ; }
Which could be different