#ifndef _SERVICE_MATH_ABSOLUTE_H_ #define _SERVICE_MATH_ABSOLUTE_H_ namespace service { namespace math { template struct Relative; // Start addition template struct Absolute; template Absolute operator +(Relative const&, Absolute const&); template Absolute operator -(Relative const&, Absolute const&); // End addition template struct Absolute { Absolute(T const& rValue) : mValue(rValue) {} friend Absolute operator +(Absolute const& rLSummand, Relative const& rRSummand) { return rLSummand.mValue + rRSummand.mValue; } // error #1581 - fixed friend Absolute operator + <>(Relative const&, Absolute const&); friend Absolute operator -(Absolute const& rMinuend, Relative const& rSubtrahend) { return rMinuend.mValue - rSubtrahend.mValue; } // error #1581 - fixed friend Absolute operator - <>(Relative const&, Absolute const&); friend Relative operator -(Absolute const& rMinuend, Absolute const& rSubtrahend) { return rMinuend.mValue - rSubtrahend.mValue; } friend bool operator ==(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue == rRhs.mValue; } friend bool operator !=(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue != rRhs.mValue; } friend bool operator <(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue < rRhs.mValue; } friend bool operator <=(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue <= rRhs.mValue; } friend bool operator >(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue > rRhs.mValue; } friend bool operator >=(Absolute const& rLhs, Absolute const& rRhs) { return rLhs.mValue >= rRhs.mValue; } T mValue; }; } /* namespace math */ } /* namespace service */ #endif /* _SERVICE_MATH_ABSOLUTE_H_ */