mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Allow SmallString to implicitly convert to StringRef.
llvm-svn: 89529
This commit is contained in:
parent
455f4d8400
commit
bd57261f1f
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user