summaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-internal.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-17 19:31:00 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-17 19:31:00 (GMT)
commit55d166a2228d7e3b3500b8651ab9b8e56fb43b7e (patch)
treee7ef15e366514486e98b985e45f72a4b76bf6471 /include/gtest/internal/gtest-internal.h
parent65f2fd5920ad2b761e48d070b32540af1a09c531 (diff)
downloadgoogletest-55d166a2228d7e3b3500b8651ab9b8e56fb43b7e.zip
googletest-55d166a2228d7e3b3500b8651ab9b8e56fb43b7e.tar.gz
googletest-55d166a2228d7e3b3500b8651ab9b8e56fb43b7e.tar.bz2
Adds GTEST_REMOVE_REFERENCE_AND_CONST_.
Diffstat (limited to 'include/gtest/internal/gtest-internal.h')
-rw-r--r--include/gtest/internal/gtest-internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h
index 3c5d1f7..bf8412b 100644
--- a/include/gtest/internal/gtest-internal.h
+++ b/include/gtest/internal/gtest-internal.h
@@ -842,6 +842,10 @@ struct RemoveConst<T[N]> {
#define GTEST_REMOVE_CONST_(T) \
typename ::testing::internal::RemoveConst<T>::type
+// Turns const U&, U&, const U, and U all into U.
+#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
+ GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
+
// Adds reference to a type if it is not a reference type,
// otherwise leaves it unchanged. This is the same as
// tr1::add_reference, which is not widely available yet.
@@ -1046,7 +1050,7 @@ class NativeArray {
// Ensures that the user doesn't instantiate NativeArray with a
// const or reference type.
static_cast<void>(StaticAssertTypeEqHelper<Element,
- GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(Element))>());
+ GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
if (relation_to_source_ == kCopy)
delete[] array_;
}