From: Xiaoyang Gao Date: Tue, 7 Aug 2012 01:53:02 +0000 (-0700) Subject: Add operator== and operator!= to folly::StlAllocator X-Git-Tag: v0.22.0~1225 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0286cb336e11fa933d4f79552e266e1e6ff88931;p=folly.git Add operator== and operator!= to folly::StlAllocator Summary: Add operator== and operator!= to folly::StlAllocator, which are required by some other libraries. Test Plan: Tested by running with recursive_wrapper in boost::variant, and unit tests in folly/test. Reviewed By: delong.j@fb.com FB internal diff: D541237 --- diff --git a/folly/StlAllocator.h b/folly/StlAllocator.h index 5cefb240..3848343d 100644 --- a/folly/StlAllocator.h +++ b/folly/StlAllocator.h @@ -116,6 +116,14 @@ class StlAllocator { typedef StlAllocator other; }; + bool operator!=(const StlAllocator& other) const { + return alloc_ != other.alloc_; + } + + bool operator==(const StlAllocator& other) const { + return alloc_ == other.alloc_; + } + private: Alloc* alloc_; };