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
Родитель 8ebcff8383
Коммит e22cba5e2b
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -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
/*