Normalizing argument types of CEarthAngle comparison and arithmetic operators:

argument type should be same type as the this pointer.
This commit is contained in:
Mathew Sutcliffe
2014-01-14 00:51:41 +00:00
parent f156916c0c
commit a23c9e3f07
2 changed files with 9 additions and 9 deletions

View File

@@ -94,7 +94,7 @@ namespace BlackMisc
*/ */
template <class LATorLON> int CEarthAngle<LATorLON>::compareImpl(const CValueObject &otherBase) const template <class LATorLON> int CEarthAngle<LATorLON>::compareImpl(const CValueObject &otherBase) const
{ {
const auto &other = static_cast<const LATorLON &>(otherBase); const auto &other = static_cast<const CEarthAngle &>(otherBase);
if (*this < other) { return -1; } if (*this < other) { return -1; }
else if (*this > other) { return 1; } else if (*this > other) { return 1; }

View File

@@ -89,7 +89,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator==(const LATorLON &latOrLon) const bool operator==(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator ==(latOrLon); return this->CAngle::operator ==(latOrLon);
} }
@@ -99,7 +99,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator!=(const LATorLON &latOrLon) const bool operator!=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator !=(latOrLon); return this->CAngle::operator !=(latOrLon);
} }
@@ -131,7 +131,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator >(const LATorLON &latOrLon) const bool operator >(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >(latOrLon); return this->CAngle::operator >(latOrLon);
} }
@@ -141,7 +141,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator <(const LATorLON &latOrLon) const bool operator <(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >(latOrLon); return this->CAngle::operator >(latOrLon);
} }
@@ -151,7 +151,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator <=(const LATorLON &latOrLon) const bool operator <=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator <=(latOrLon); return this->CAngle::operator <=(latOrLon);
} }
@@ -161,7 +161,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
bool operator >=(const LATorLON &latOrLon) const bool operator >=(const CEarthAngle &latOrLon) const
{ {
return this->CAngle::operator >=(latOrLon); return this->CAngle::operator >=(latOrLon);
} }
@@ -171,7 +171,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
LATorLON operator +(const LATorLON &latOrLon) const LATorLON operator +(const CEarthAngle &latOrLon) const
{ {
LATorLON l(*this); LATorLON l(*this);
l += latOrLon; l += latOrLon;
@@ -183,7 +183,7 @@ namespace BlackMisc
* \param latOrLon * \param latOrLon
* \return * \return
*/ */
LATorLON operator -(const LATorLON &latOrLon) const LATorLON operator -(const CEarthAngle &latOrLon) const
{ {
LATorLON l(*this); LATorLON l(*this);
l -= latOrLon; l -= latOrLon;