Commit 0286cb33 authored by Xiaoyang Gao's avatar Xiaoyang Gao Committed by Tudor Bosman

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
parent 367a8b2c
...@@ -116,6 +116,14 @@ class StlAllocator { ...@@ -116,6 +116,14 @@ class StlAllocator {
typedef StlAllocator<Alloc, U> other; 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: private:
Alloc* alloc_; Alloc* alloc_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment