commit | a5927ba45d020a0a4270c67ab98e2b5b308a1322 | [log] [tgz] |
---|---|---|
author | Guillaume Chatelet <gchatelet@google.com> | Thu Apr 15 15:55:37 2021 +0000 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Apr 16 12:21:32 2021 -0700 |
tree | 791352f790454d19d7768d132e656feac787792a | |
parent | d54e4d26e3c55c175b1fd77c2cf8df13dc847631 [diff] |
[libc] Add index operator[] to StringView GitOrigin-RevId: 03375089f5a66a5fa4dc7b30e6b62e7e69086226
diff --git a/utils/CPP/StringView.h b/utils/CPP/StringView.h index 2e7b3a0..52f61a0 100644 --- a/utils/CPP/StringView.h +++ b/utils/CPP/StringView.h
@@ -45,6 +45,8 @@ size_t size() { return Len; } + const char &operator[](size_t Index) const { return Data[Index]; } + StringView remove_prefix(size_t N) const { if (N >= Len) return StringView();