I am trying to cvopy boost::array<char> to std::string.
boost::array<char, 1024> _buffer;
std::string data;
std::copy(_buffer.begin(), _buffer.begin()+bytes_transferred, data.begin());
which is not working. So I changed it a little bit.
char _buffer[1024];
std::string data;
std::copy(_buffer, _buffer+bytes_transferred, data.begin());
second one is not working either.
You can use back_insert_iterator. Assigning to it will call
push_backfunction of the underlying container so you don’t need to worry with allocating space manually.