문제

I am trying to insert rectangle objects to a tree. This is the implementation of insert function.

void TwoDimTree::insertNewNode(Rectangle dataIn)
{
insertNewRectangleUtility((&tree), dataIn); 
}


void TwoDimTree::insertNewRectangleUtility(TwoDimTree** temp, Rectangle dataIn)
{
//code here...

}

Compiler gives error C2664(cannot convert parameter 2 from Rectangle to Rectangle) in third line:

 insertNewRectangleUtility((&tree), dataIn);

What should I do?

도움이 되었습니까?

해결책

Given the error message, I would bet on an explicit, private, or deleted copy constructor. Mostly likely, the copy constructor is explicit in which case you can copy Rectangle explicitly but not implicitly like when passing objects of type Rectangle as argument or when returning them from functions. Since you haven't posted the definition of the class Rectangle I can't tell for sure, though.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top