Add an operator+= for appending StringRefs onto std::strings.

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
This commit is contained in:
John McCall 2011-05-13 23:58:45 +00:00
parent 1c3c8ea662
commit 6765f78efb

View File

@ -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.