blueloveTH %!s(int64=2) %!d(string=hai) anos
pai
achega
53c84abe56
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/str.h

+ 6 - 0
src/str.h

@@ -201,6 +201,12 @@ struct Str{
         return p;
     }
 
+    const char* c_str_temp() const {
+        static THREAD_LOCAL std::string temp;
+        temp.assign(data, size);
+        return temp.c_str();
+    }
+
     std::string_view sv() const {
         return std::string_view(data, size);
     }