OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c3c8ea
)
Add an operator+= for appending StringRefs onto std::strings.
author
John McCall
<rjmccall@apple.com>
Fri, 13 May 2011 23:58:45 +0000
(23:58 +0000)
committer
John McCall
<rjmccall@apple.com>
Fri, 13 May 2011 23:58:45 +0000
(23:58 +0000)
Previously this pattern would be compiled using an implicit conversion
to std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131325
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/StringRef.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/StringRef.h
b/include/llvm/ADT/StringRef.h
index
1766d2b
..
dcc6aa2
100644
(file)
--- a/
include/llvm/ADT/StringRef.h
+++ b/
include/llvm/ADT/StringRef.h
@@
-447,6
+447,10
@@
namespace llvm {
return LHS.compare(RHS) != -1;
}
+ inline std::string &operator+=(std::string &buffer, llvm::StringRef string) {
+ return buffer.append(string.data(), string.size());
+ }
+
/// @}
// StringRefs can be treated like a POD type.