| Index: base/memory/scoped_ptr_unittest.cc
|
| diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
|
| index 71d995c452e826ad1faeb28f315433077f338e88..dcb3e85d91c7e16bebbe3d3390fa2dce9f73fe91 100644
|
| --- a/base/memory/scoped_ptr_unittest.cc
|
| +++ b/base/memory/scoped_ptr_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
|
|
| #include <sstream>
|
| +#include <vector>
|
|
|
| #include "base/basictypes.h"
|
| #include "base/bind.h"
|
| @@ -716,3 +717,31 @@ TEST(ScopedPtrTest, ReferenceCycle) {
|
| // definition of unique_ptr::reset in C++11.
|
| a->b.reset();
|
| }
|
| +
|
| +template<typename T>
|
| +class ScopedPtr2 {
|
| + MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ScopedPtr2)
|
| + public:
|
| + explicit ScopedPtr2(T* p) : p_(p) { }
|
| + ~ScopedPtr2() { delete p_; }
|
| +
|
| + ScopedPtr2(ScopedPtr2&& rhs) : p_(nullptr) {
|
| + using std::swap;
|
| + swap(p_, rhs.p_);
|
| + }
|
| +
|
| + ScopedPtr2& operator=(ScopedPtr2&& rhs) {
|
| + using std::swap;
|
| + swap(p_, rhs.p_);
|
| + }
|
| +
|
| + private:
|
| + T* p_;
|
| +};
|
| +
|
| +TEST(ScopedPtrTest, VectorOfScopedPtrs) {
|
| + class TestClassPleaseIgnore {
|
| + };
|
| + std::vector<ScopedPtr2<TestClassPleaseIgnore>> x;
|
| + x.push_back(ScopedPtr2<TestClassPleaseIgnore>(new TestClassPleaseIgnore));
|
| +}
|
|
|