If I have 2 constructor overloads
calculations(double vector, double angle);
calculations(double horizontalVector, double verticalVector);
How can I ensure the compiler specifically uses one of the overloads that I choose (as each of them do different things behind the scenes)?
If you want to have overloads, the types needs to be different. One way to do this is the so called whole value idiom.
Make a
struct
for each parameters: a vector (watching out for potential name clashes), angle and so on.The you will have two different constructors.