I'd like to encapsulate a float
in two structures for example:
struct AngleDeg {
explicit AngleDeg(float angle):value(angle) {}
float value;
};
struct AngleRad {
explicit AngleRad(float angle):value(angle) {}
float value;
};
Then in a class overload a function using these structs, something like:
...
void DoStuff(AngleRad angle);
inline void DoStuff(AngleDeg angle) { DoStuff(Deg2Rad(angle.value)); }
...
Will this be as efficient as using the following two functions ?
void DoStuffRad(float angle);
inline void DoStuffDeg(float angle) { DoStuffRad(Deg2Rad(angle)); }