I have a constructor that looks like this:
Thing::Thing(std::vector<uint8> & data){
m_data = data; // m_data is also a vector<uint8>
// do other stuff
}
However, data
holds a pretty large chunk of memory, and instead of copying it, I'd like data
to simply give it up to m_data
, as the caller will never need it after constructing this object. What's the best way to do this in C++?