1 #ifndef INCLUDED_BUFFER_H
2 #define INCLUDED_BUFFER_H
8 using cstring = const char *;
16 Reference(int m_size, byte *m_data)
17 : m_size(m_size), m_data(m_data) {}
23 const byte *data() const {
40 const byte *data() const {
51 class IBuffer : Self {
54 operator const IBuffer<details::Reference>() const {
55 return IBuffer<details::Reference>{this->size(), const_cast<byte *>(this->data())};
58 cstring c_str() const {
68 using BufferVal = IBuffer<details::Value<sz>>;
70 using Buffer = IBuffer<details::Reference>;
73 BufferVal<sz> buffer() {
74 return BufferVal<sz>();