...
This commit is contained in:
@@ -129,15 +129,26 @@ public:
|
||||
return sexagesimal<std::string>(hms, prec);
|
||||
}
|
||||
|
||||
friend MccCoordinate operator+(const MccCoordinate& left, const MccCoordinate& right)
|
||||
friend MccCoordinate operator+(std::convertible_to<MccCoordinate> auto&& left,
|
||||
std::convertible_to<MccCoordinate> auto&& right)
|
||||
{
|
||||
return left._angleInRads + right._angleInRads;
|
||||
return std::forward<decltype(left)>(left)._angleInRads + std::forward<decltype(right)>(right)._angleInRads;
|
||||
}
|
||||
// friend MccCoordinate operator+(const MccCoordinate& left, const MccCoordinate& right)
|
||||
// {
|
||||
// return left._angleInRads + right._angleInRads;
|
||||
// }
|
||||
|
||||
friend MccCoordinate operator-(const MccCoordinate& left, const MccCoordinate& right)
|
||||
|
||||
friend MccCoordinate operator-(std::convertible_to<MccCoordinate> auto&& left,
|
||||
std::convertible_to<MccCoordinate> auto&& right)
|
||||
{
|
||||
return left._angleInRads + right._angleInRads;
|
||||
return std::forward<decltype(left)>(left)._angleInRads - std::forward<decltype(right)>(right)._angleInRads;
|
||||
}
|
||||
// friend MccCoordinate operator-(const MccCoordinate& left, const MccCoordinate& right)
|
||||
// {
|
||||
// return left._angleInRads + right._angleInRads;
|
||||
// }
|
||||
|
||||
template <typename T>
|
||||
MccCoordinate operator*(T&& scalar)
|
||||
@@ -187,6 +198,26 @@ public:
|
||||
_angleInRads /= scalar;
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto operator<=>(const MccCoordinate& other) const
|
||||
{
|
||||
return _angleInRads <=> other._angleInRads;
|
||||
}
|
||||
|
||||
auto operator==(const MccCoordinate& other) const
|
||||
{
|
||||
return _angleInRads == other._angleInRads;
|
||||
}
|
||||
|
||||
auto operator<=>(double other) const
|
||||
{
|
||||
return _angleInRads <=> other;
|
||||
}
|
||||
|
||||
auto operator==(double other) const
|
||||
{
|
||||
return _angleInRads == other;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user