referance objects cause "no match for" kinds error

hello, while I was using msvc I could use a referance and actual object interchangably however when I switch to g++ 4x, I start getting no match for ... kind of errors, here is a stuation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
		ImageDataPtr& operator= (ImageDataPtr& p) {
			if(ptr != p.ptr) {
				dispose();
				ptr = p.getPtr();
				count = p.getCount();
				++*count;
			}
			return *this;
		}

ImageDataPtr copyImage(ImageData* bitmap, Vec4 box);



ImageDataPtr lenaImgPtr(c.decode(lena));


/* this line cause a no match error because copyImage returns ImgDataPtr
*  however, there is only one "=" operator in ImgDataPtr which takes ImgDataPtr&
*/
lenaImgPtr = c.copyImage(lenaImgPtr.getPtr(), Vec4(0,0,400,400));


this kind of usage was valid for mscv and seems correct to me as well :) saves me from writing same thing
hmmmm... try to compile with another program ...
i dont see anything wrong...
Topic archived. No new replies allowed.