projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf147c4
)
[libc] Add index operator[] to StringView
author
Guillaume Chatelet
<gchatelet@google.com>
Thu, 15 Apr 2021 15:55:37 +0000
(15:55 +0000)
committer
Guillaume Chatelet
<gchatelet@google.com>
Thu, 15 Apr 2021 15:55:37 +0000
(15:55 +0000)
libc/utils/CPP/StringView.h
patch
|
blob
|
history
diff --git
a/libc/utils/CPP/StringView.h
b/libc/utils/CPP/StringView.h
index
2e7b3a0
..
52f61a0
100644
(file)
--- a/
libc/utils/CPP/StringView.h
+++ b/
libc/utils/CPP/StringView.h
@@
-45,6
+45,8
@@
public:
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();