The following has a very strange error:
In a header somewhere I have:
class WCameraPosition : public Widget3D
{
public:
WCameraPosition(double scale = 1.0);
WCameraPosition(const Matx33d &K, double scale = 1.0, const Color &color = Color::white());
WCameraPosition(const Vec2d &fov, double scale = 1.0, const Color &color = Color::white());
WCameraPosition(const Matx33d &K, InputArray image, double scale = 1.0, const Color &color = Color::white());
WCameraPosition(const Vec2d &fov, InputArray image, double scale = 1.0, const Color &color = Color::white());
};
class Widget3D : public Widget
{
public:
Widget3D() {}
//...
}
typedef Matx<double, 3, 3> Matx33d;
For some reason the following compiles:
WCameraPosition camSymbol1(Matx33d(K));
WCameraPosition camSymbol2(1.0);
Widget w(camSymbol2);
But this does not:
WCameraPosition camSymbol1(Matx33d(K));
WCameraPosition camSymbol2(1.0);
Widget w(camSymbol1);
I get the error:
error: no matching function for call to ‘Widget3D::Widget3D(
WCameraPosition (&)(Matx33d))’
note: Widget3D::Widget3D(const Widget3D&)
no known conversion for argument 1 from ‘WCameraPosition(Matx33d)
{aka WCameraPosition(Matx<double, 3, 3>)}’ to
‘const Widget3D&’
I'm utterly befuddled by this. It is as if a new templated type was created, but WCameraPosition and its superclasses don't even use templates. I need to pass camSymbol1 to functions taking Widget3D&. How do I fix this?