I have the following class declaration:
class DepthDescriptor
{
public:
DepthDescriptor(DepthType depth);
bool operator==(DepthDescriptor& type);
bool operator>=(DepthDescriptor& type);
bool operator<=(DepthDescriptor& type);
...
}
Why does the following line not perform an implicit conversion to the DepthDescriptor object so that the operator comparison can take place?
if (depth == Depth_8U)
{
...
}
Note that depth is a DepthDescriptor object, DepthType is an enum, and Depth_8U is one of the enum values. I was hoping that lines like the one above would first call the implicit constructor DepthDescriptor(DepthType depth) and then the appropriate operator, but I’m getting no operator "==" matches these operands.
Try