Original Post
Hi, im implementing a template class for image processing. I've overloaded operator+ template Image& Image::operator+ (const Image& img2){ Image ret(xdim, ydim); int i = 0; for(i=0;i<(ydim*xdim);i++){ ret.data = data + img2.data; } return ret; } but when i want to avaluate a = b+c this overlaoded funtion first needs to create image to store the sum. How can i store the sums direktrly in 'a'. A workaround woult be use somting like a.sum(b,c). tnx gsus