Makes gtest compile cleanly with MSVC's warning 4511 & 4512 (copy ctor /

assignment operator cannot be generated) enabled.
This commit is contained in:
zhanyong.wan
2009-09-18 16:35:15 +00:00
parent f43e4ff3ad
commit 9f894c2b36
6 changed files with 293 additions and 35 deletions

View File

@@ -248,6 +248,9 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
: base_(other.base_), value_(other.value_), index_(other.index_),
step_(other.step_) {}
// No implementation - assignment is unsupported.
void operator=(const Iterator& other);
const ParamGeneratorInterface<T>* const base_;
T value_;
int index_;
@@ -263,6 +266,9 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
return end_index;
}
// No implementation - assignment is unsupported.
void operator=(const RangeGenerator& other);
const T begin_;
const T end_;
const IncrementT step_;
@@ -349,7 +355,10 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
// Use of scoped_ptr helps manage cached value's lifetime,
// which is bound by the lifespan of the iterator itself.
mutable scoped_ptr<const T> value_;
};
}; // class ValuesInIteratorRangeGenerator::Iterator
// No implementation - assignment is unsupported.
void operator=(const ValuesInIteratorRangeGenerator& other);
const ContainerType container_;
}; // class ValuesInIteratorRangeGenerator