What is the advantages of using vector? I would still have to declare an assignment operator and a copy assignment operator. Or is is there any other advantage? Btw, do vector copy the array data during assignment? The simplest way can imagine is to use byte* instead of vector (constructors taking adress to the pixels still take void*), and just copy the pointer during assignment, then I don't have to wory about the behaviour of vector either. Else the code
would first create an array of pixeldata, then copy the data into a new memory allocation, and loose the reference to the original data when the assignment has finished. All copying of pixeldata shall be done not by assignment, but a separate copy image function.Code:dest_image = mp_image(w/n, h/n);
That make sense, I should consider using that method instead.