Chromium Code Reviews| Index: third_party/base/stl_util.h |
| diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h |
| index 2d1846724c3094161ce910986fd13be10c7b9f62..013a4c8bc17479f59d9501ce3a94ea630273ba66 100644 |
| --- a/third_party/base/stl_util.h |
| +++ b/third_party/base/stl_util.h |
| @@ -27,6 +27,15 @@ bool ContainsValue(const Collection& collection, const Value& value) { |
| collection.end(); |
| } |
| +// Means of generating a key for std::set<std::unique_ptr> that avoids |
| +// the side effect of destroying the key. |
| +template <class T> |
| +class LeakPtr : public std::unique_ptr<T> { |
| + public: |
| + using std::unique_ptr<T>::unique_ptr; |
| + ~LeakPtr() { std::unique_ptr<T>::release(); } |
| +}; |
|
Tom Sepez
2016/08/19 17:20:52
Note: Dan, I didn't stub the other methods, readin
|
| + |
| // Convenience routine for "int-fected" code, so that the stl collection |
| // size_t size() method return values will be checked. |
| template <typename ResultType, typename Collection> |