I think you can not differentiate 2 constructors with the same parameters. To fix this problem you have to create particular classes for your coordinate types. It is very simple to do this. Just use following code.
Code:
struct CartCoords {
CartCoord( double res, double imgs ) : mRe(res), mImg(imgss) {}
double mRess, mImgss;
};
struct PolatCoord {
PolarCoord( double ass, double vss ) : mA(as), mV(vs) {}
double mAs, mVs;
};
After this your constructors become:
Code:
Complex( const CartCoords & cs );
Complex( const PolarCoords & cs);
You have to use:
Code:
Complex cs( CartCoords( 1, 2 ) );
Bookmarks