Permalink
Browse files

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
  • Loading branch information...
1 parent 367a8b2 commit 0286cb336e11fa933d4f79552e266e1e6ff88931 Xiaoyang Gao committed with tudor Aug 7, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 folly/StlAllocator.h
View
8 folly/StlAllocator.h
@@ -116,6 +116,14 @@ class StlAllocator {
typedef StlAllocator<Alloc, U> other;
};
+ bool operator!=(const StlAllocator<Alloc, T>& other) const {
+ return alloc_ != other.alloc_;
+ }
+
+ bool operator==(const StlAllocator<Alloc, T>& other) const {
+ return alloc_ == other.alloc_;
+ }
+
private:
Alloc* alloc_;
};

0 comments on commit 0286cb3

Please sign in to comment.