Bug 1122160 Add operator+=() and operator-=() to DebugOnly r=froydnj

This commit is contained in:
Ben Kelly 2015-01-16 09:59:32 -05:00
parent c2bdc6fdf5
commit 8e1c7e285b

View File

@ -51,6 +51,10 @@ public:
void operator++(int) { value++; }
void operator--(int) { value--; }
// Do not define operator+=() or operator-=() here. These will coerce via
// the implicit cast and built-in ooperators. Defining explicit methods here
// will create ambiguity the compiler can't deal with.
T* operator&() { return &value; }
operator T&() { return value; }
@ -66,6 +70,8 @@ public:
DebugOnly& operator=(const T&) { return *this; }
void operator++(int) { }
void operator--(int) { }
DebugOnly& operator+=(const T&) { return *this; }
DebugOnly& operator-=(const T&) { return *this; }
#endif
/*