Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top