mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1354090: P2. Add operator+(val). r=gerald
Such that: [x, y] + a = [x+a, y+a] MozReview-Commit-ID: HlyI9KmVtTg --HG-- extra : rebase_source : ef5d9e942d365fbcffd796a1762bd89a042272e7
This commit is contained in:
parent
fa2ce72185
commit
137766e6ad
@ -101,6 +101,11 @@ public:
|
||||
mFuzz + aOther.mFuzz);
|
||||
}
|
||||
|
||||
SelfType operator+ (const T& aVal) const
|
||||
{
|
||||
return SelfType(mStart + aVal, mEnd + aVal, mFuzz);
|
||||
}
|
||||
|
||||
// Basic interval arithmetic operator definition.
|
||||
SelfType operator- (const SelfType& aOther) const
|
||||
{
|
||||
@ -109,6 +114,11 @@ public:
|
||||
mFuzz + aOther.mFuzz);
|
||||
}
|
||||
|
||||
SelfType operator- (const T& aVal) const
|
||||
{
|
||||
return SelfType(mStart - aVal, mEnd - aVal, mFuzz);
|
||||
}
|
||||
|
||||
bool operator== (const SelfType& aOther) const
|
||||
{
|
||||
return mStart == aOther.mStart && mEnd == aOther.mEnd;
|
||||
|
Loading…
Reference in New Issue
Block a user