Provide ostream output for StringRef.

This commit is contained in:
Peter Johnson
2015-07-31 23:20:59 -07:00
parent 3a71acec52
commit 06e8d835dd

View File

@@ -14,6 +14,7 @@
#include <cassert>
#include <cstring>
#include <limits>
#include <ostream>
#include <string>
#include <utility>
@@ -523,6 +524,11 @@ namespace llvm {
return buffer.append(string.data(), string.size());
}
inline std::ostream &operator<<(std::ostream &os, StringRef string) {
os.write(string.data(), string.size());
return os;
}
/// @}
// StringRefs can be treated like a POD type.