From 0286cb336e11fa933d4f79552e266e1e6ff88931 Mon Sep 17 00:00:00 2001 From: Xiaoyang Gao Date: Mon, 6 Aug 2012 18:53:02 -0700 Subject: [PATCH] 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 --- folly/StlAllocator.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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_; }; -- 2.34.1