diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-12-23 00:09:23 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-12-23 00:09:23 +0000 |
commit | 7b0c8dd3a94fed17493e2f01dc2fa32bc1eb3a20 (patch) | |
tree | 1386fe7c08826bf9736000ac85184f9d32bf0270 /include | |
parent | 940ce8a21024d9eb4221e5a9375615dbca926061 (diff) | |
download | googletest-7b0c8dd3a94fed17493e2f01dc2fa32bc1eb3a20.tar.gz googletest-7b0c8dd3a94fed17493e2f01dc2fa32bc1eb3a20.tar.bz2 googletest-7b0c8dd3a94fed17493e2f01dc2fa32bc1eb3a20.zip |
Adds macro GTEST_DISALLOW_ASSIGN_, needed by gmock.
Diffstat (limited to 'include')
-rw-r--r-- | include/gtest/internal/gtest-port.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index 253ce18e..fcca592e 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -105,6 +105,7 @@ // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a // variable don't have to be used. +// GTEST_DISALLOW_ASSIGN_ - disables operator=. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. // @@ -163,6 +164,8 @@ #endif // !_WIN32_WCE #include <iostream> // NOLINT +#include <sstream> // NOLINT +#include <string> // NOLINT #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" #define GTEST_FLAG_PREFIX_ "gtest_" @@ -295,9 +298,6 @@ (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) #endif // GTEST_HAS_GLOBAL_WSTRING -#include <string> // NOLINT -#include <sstream> // NOLINT - // Determines whether RTTI is available. #ifndef GTEST_HAS_RTTI // The user didn't tell us whether RTTI is enabled, so we need to @@ -501,11 +501,16 @@ #define GTEST_ATTRIBUTE_UNUSED_ #endif -// A macro to disallow the evil copy constructor and operator= functions +// A macro to disallow operator= +// This should be used in the private: declarations for a class. +#define GTEST_DISALLOW_ASSIGN_(type)\ + void operator=(type const &) + +// A macro to disallow copy constructor and operator= // This should be used in the private: declarations for a class. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ - type(const type &);\ - void operator=(const type &) + type(type const &);\ + GTEST_DISALLOW_ASSIGN_(type) // Tell the compiler to warn about unused return values for functions declared // with this macro. The macro should be used on function declarations |