Allow SmallString to implicitly convert to StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89529 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-11-21 02:01:24 +00:00
parent 80bf1d5278
commit 983c7fe847

View File

@ -38,12 +38,15 @@ public:
// Extra methods.
StringRef str() const { return StringRef(this->begin(), this->size()); }
// Implicit conversion to StringRef.
operator StringRef() const { return str(); }
const char *c_str() {
this->push_back(0);
this->pop_back();
return this->data();
}
// Extra operators.
const SmallString &operator=(StringRef RHS) {
this->clear();