ImmutableString, StringRef: Add empty() and operator[]
We won't add operator[] to StringRef. This is because it may be undefined if pos == size(), and StringRef's base + len does not point to the valid region. This solely depends on the given buffer, so we cannot do anything to fix. For workaround, if we need this kind of operator, we may add it under another name, like char_at(size_type).
Showing
Please register or sign in to comment