From 55d166a2228d7e3b3500b8651ab9b8e56fb43b7e Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Mon, 17 May 2010 19:31:00 +0000 Subject: Adds GTEST_REMOVE_REFERENCE_AND_CONST_. --- include/gtest/internal/gtest-internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h index 3c5d1f76..bf8412b9 100644 --- a/include/gtest/internal/gtest-internal.h +++ b/include/gtest/internal/gtest-internal.h @@ -842,6 +842,10 @@ struct RemoveConst { #define GTEST_REMOVE_CONST_(T) \ typename ::testing::internal::RemoveConst::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(StaticAssertTypeEqHelper()); + GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>()); if (relation_to_source_ == kCopy) delete[] array_; } -- cgit v1.2.3