I have a vector of bytes (std::vector ): [1,1,1,9,9,9,1,1,1]
I want to replace bytes 3-6 with unknown length of bytes (I'll know at run time obv.). So the length of the vector may grow, shirk or stay the same. But I know the start point and end point of the bytes I want to replace.
I can do this using erase or insert to adjust the size, then a loop around the new data onto the old data.
std::replace does a search and the replaces matching the bytes, whereas I know what bytes I want to replace. And std::replace seem to only replace one element. I want to replace with blob of data.
Surely there is a std function that can do this 'neatly'? (and I'll call you Shirely if I want to).