tags:

views:

28

answers:

2
class ADot :
    public Shape
{
private:
    Point me_;
    operator D2D1_POINT_2F() const;//HERE I HAVE CONVERSION OPERATOR BUT IT DOES NOT WORK
public:
    ADot(signed, signed);
    ~ADot(void);
    void draw()const;
    Point center() const;
    Point north() const;
    Point south() const;
    Point east() const;
    Point west() const;
    Point nw() const;
    Point ne() const;
    Point sw() const;
    Point se() const;
};

error: Error 7 error C2664: 'D2D1::Ellipse' : cannot convert parameter 1 from 'const Point' to 'const D2D1_POINT_2F &'

I'm getting this error but I do not know how to write operator which would convert my const object to const D2D1_POINT_2F.

Thank you.

+1  A: 

The operator is declared PRIVATE. Make it public

You are also trying to convert a Point to D2D1_POINT_2F, but the operator is declared in ADot class

Gobra
+1  A: 

You need to implement the conversion operator. All you've stated there is that such a conversion exists - you have not defined how the conversion works. It also needs to be public.

Visage