Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed...
[oota-llvm.git] / include / llvm / ADT / SmallString.h
index 035462515a83e96d1a1e5be3edb89ff80fc0e7a6..05bd8a42c67f650c967e3212298deb3dda111b9a 100644 (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();