X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FThreadCachedInt.h;h=58816e37f363e7ef88b3188ff69133d03eec1ff7;hb=ad1bc24381d332f39052c6bc00192fc5c14db11d;hp=3ed53b20bacf584e1951c70f8dd49a5f2fa893f2;hpb=ed8c80a0e0988e4ce687f51ca832a00e4a6b7930;p=folly.git diff --git a/folly/ThreadCachedInt.h b/folly/ThreadCachedInt.h index 3ed53b20..58816e37 100644 --- a/folly/ThreadCachedInt.h +++ b/folly/ThreadCachedInt.h @@ -110,7 +110,10 @@ class ThreadCachedInt : boost::noncopyable { ThreadCachedInt& operator-=(IntT inc) { increment(-inc); return *this; } // pre-increment (we don't support post-increment) ThreadCachedInt& operator++() { increment(1); return *this; } - ThreadCachedInt& operator--() { increment(-1); return *this; } + ThreadCachedInt& operator--() { + increment(IntT(-1)); + return *this; + } // Thread-safe set function. // This is a best effort implementation. In some edge cases, there could be