Kaynağa Gözat

cast for buffer

Kajetan Johannes Hammerle 3 yıl önce
ebeveyn
işleme
553ad7a1f0
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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