Bug 1171330: P3. Add -=, - and * (with integer) operators to TimeUnit. r=mattwoodrow

--HG--
extra : rebase_source : 2e74a69d9ee15e55276ba9e65b3422f415b44efd
This commit is contained in:
Jean-Yves Avenard 2015-06-11 15:49:49 +10:00
Родитель e70b22a0e9
Коммит 75acd77984
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -173,6 +173,21 @@ public:
MOZ_ASSERT(!IsInfinite() && !aOther.IsInfinite());
return TimeUnit(mValue - aOther.mValue);
}
TimeUnit& operator += (const TimeUnit& aOther) {
*this = *this + aOther;
return *this;
}
TimeUnit& operator -= (const TimeUnit& aOther) {
*this = *this - aOther;
return *this;
}
friend TimeUnit operator* (int aVal, const TimeUnit& aUnit) {
return TimeUnit(aUnit.mValue * aVal);
}
friend TimeUnit operator* (const TimeUnit& aUnit, int aVal) {
return TimeUnit(aUnit.mValue * aVal);
}
bool IsValid() const
{