Explorar el Código

cast for buffer

Kajetan Johannes Hammerle hace 3 años
padre
commit
553ad7a1f0
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      utils/Buffer.h

+ 5 - 0
utils/Buffer.h

@@ -9,6 +9,7 @@ class Buffer {
     int length = 0;
 
 public:
+
     template<typename T>
     Buffer& add(const T& t) {
         int bytes = N - length;
@@ -23,6 +24,10 @@ public:
     int getLength() const {
         return length;
     }
+
+    operator const char*() const {
+        return data;
+    }
 };
 
 #endif