зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1171330: P3. Add -=, - and * (with integer) operators to TimeUnit. r=mattwoodrow
--HG-- extra : rebase_source : 2e74a69d9ee15e55276ba9e65b3422f415b44efd
This commit is contained in:
Родитель
e70b22a0e9
Коммит
75acd77984
|
@ -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
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче