aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-spec-builders.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gmock/gmock-spec-builders.h')
-rw-r--r--include/gmock/gmock-spec-builders.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/gmock/gmock-spec-builders.h b/include/gmock/gmock-spec-builders.h
index af2e8ad2..cc48bc0b 100644
--- a/include/gmock/gmock-spec-builders.h
+++ b/include/gmock/gmock-spec-builders.h
@@ -1359,6 +1359,20 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
std::vector<DefaultActionSpec<F> > default_actions_;
// All expectations for this function mocker.
Expectations expectations_;
+
+ // There is no generally useful and implementable semantics of
+ // copying a mock object, so copying a mock is usually a user error.
+ // Thus we disallow copying function mockers. If the user really
+ // wants to copy a mock object, he should implement his own copy
+ // operation, for example:
+ //
+ // class MockFoo : public Foo {
+ // public:
+ // // Defines a copy constructor explicitly.
+ // MockFoo(const MockFoo& src) {}
+ // ...
+ // };
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);
}; // class FunctionMockerBase
#ifdef _MSC_VER