#include <cstring> CommonSessionMessage::CommonSessionMessage(const char* data, int size) : m_data(new char[size]) { std::memcpy(m_data, data, size); }
It seems that m_data is of type char* . If so, then it does not have a get() function, and m_data.get() does not make sense in your code.
An alternative solution would use std::copy as:
#include<algorithm> CommonSessionMessage::CommonSessionMessage(const char* data, int size) : m_data(new char[size]) { std::copy(data, data + size, m_data); }
I would prefer a second solution. Read the std::copy documentation.
Nawaz source share